/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('chatbot', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ApplyForStreamAccessTokenRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
}

model ApplyForStreamAccessTokenResponseBody = {
  accessToken?: string(name='AccessToken', example='63ba97b4f18a4a04f715c81e8e643938'),
  channelId?: string(name='ChannelId', example='cc9e88c0-4f41-4f1d-a1a9-91a72d2aa27d'),
  requestId?: string(name='RequestId', description='Id of the request', example='736994BD-AA35-4742-88C9-E64BE4BAA14B'),
  streamSecret?: string(name='StreamSecret', example='cc9e88c0-4f41-4f1d-a1a9-91a72d2aa27d'),
}

model ApplyForStreamAccessTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyForStreamAccessTokenResponseBody(name='body'),
}

/**
 * @summary 申请流式网关AccessToken
 *
 * @param request ApplyForStreamAccessTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyForStreamAccessTokenResponse
 */
async function applyForStreamAccessTokenWithOptions(request: ApplyForStreamAccessTokenRequest, runtime: Util.RuntimeOptions): ApplyForStreamAccessTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyForStreamAccessToken',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 申请流式网关AccessToken
 *
 * @param request ApplyForStreamAccessTokenRequest
 * @return ApplyForStreamAccessTokenResponse
 */
async function applyForStreamAccessToken(request: ApplyForStreamAccessTokenRequest): ApplyForStreamAccessTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyForStreamAccessTokenWithOptions(request, runtime);
}

model AssociateRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  perspective?: [ string ](name='Perspective', example='["qyzzVfyFfa"]'),
  recommendNum?: long(name='RecommendNum', example='8'),
  sessionId?: string(name='SessionId', example='7c3cec23cc8940bc9db4a318c8f4f0aa'),
  utterance?: string(name='Utterance', example='公积金提取'),
}

model AssociateShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  perspectiveShrink?: string(name='Perspective', example='["qyzzVfyFfa"]'),
  recommendNum?: long(name='RecommendNum', example='8'),
  sessionId?: string(name='SessionId', example='7c3cec23cc8940bc9db4a318c8f4f0aa'),
  utterance?: string(name='Utterance', example='公积金提取'),
}

model AssociateResponseBody = {
  associate?: [ 
    {
      meta?: string(name='Meta', example='{}'),
      title?: string(name='Title', example='公积金提取的政策'),
    }
  ](name='Associate'),
  messageId?: string(name='MessageId', example='5ADF0EBD-7C50-1922-A28B-43215B47CC1A'),
  requestId?: string(name='RequestId', example='5C20F0D4-9721-178A-8236-3BF990634962'),
  sessionId?: string(name='SessionId', example='1531ded6b3df4afca4be63943f708bb7'),
}

model AssociateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateResponseBody(name='body'),
}

/**
 * @summary 会话-联想API
 *
 * @param tmpReq AssociateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateResponse
 */
async function associateWithOptions(tmpReq: AssociateRequest, runtime: Util.RuntimeOptions): AssociateResponse {
  Util.validateModel(tmpReq);
  var request = new AssociateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.perspective)) {
    request.perspectiveShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.perspective, 'Perspective', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.perspectiveShrink)) {
    query['Perspective'] = request.perspectiveShrink;
  }
  if (!Util.isUnset(request.recommendNum)) {
    query['RecommendNum'] = request.recommendNum;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.utterance)) {
    query['Utterance'] = request.utterance;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Associate',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 会话-联想API
 *
 * @param request AssociateRequest
 * @return AssociateResponse
 */
async function associate(request: AssociateRequest): AssociateResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateWithOptions(request, runtime);
}

model BeginSessionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model BeginSessionResponseBody = {
  asrMaxEndSilence?: int32(name='AsrMaxEndSilence'),
  interruptible?: boolean(name='Interruptible'),
  requestId?: string(name='RequestId', example='149C7528-C104-1B50-A4F9-0C5907A8AD9D'),
  silenceReplyTimeout?: int32(name='SilenceReplyTimeout', description='静默超时时间', example='5'),
  welcomeMessage?: string(name='WelcomeMessage', example='智能对话机器人为您服务，请问有什么可以帮您？'),
}

model BeginSessionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BeginSessionResponseBody(name='body'),
}

/**
 * @summary 获取欢迎语
 *
 * @param request BeginSessionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BeginSessionResponse
 */
async function beginSessionWithOptions(request: BeginSessionRequest, runtime: Util.RuntimeOptions): BeginSessionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BeginSession',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取欢迎语
 *
 * @param request BeginSessionRequest
 * @return BeginSessionResponse
 */
async function beginSession(request: BeginSessionRequest): BeginSessionResponse {
  var runtime = new Util.RuntimeOptions{};
  return beginSessionWithOptions(request, runtime);
}

model CancelInstancePublishTaskRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  id?: long(name='Id', example='8521'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model CancelInstancePublishTaskResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_ABORTED'),
}

model CancelInstancePublishTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelInstancePublishTaskResponseBody(name='body'),
}

/**
 * @summary 取消机器人发布
 *
 * @param request CancelInstancePublishTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelInstancePublishTaskResponse
 */
async function cancelInstancePublishTaskWithOptions(request: CancelInstancePublishTaskRequest, runtime: Util.RuntimeOptions): CancelInstancePublishTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelInstancePublishTask',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消机器人发布
 *
 * @param request CancelInstancePublishTaskRequest
 * @return CancelInstancePublishTaskResponse
 */
async function cancelInstancePublishTask(request: CancelInstancePublishTaskRequest): CancelInstancePublishTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelInstancePublishTaskWithOptions(request, runtime);
}

model CancelPublishTaskRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  id?: long(name='Id', example='8521'),
}

model CancelPublishTaskResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_ABORTED'),
}

model CancelPublishTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelPublishTaskResponseBody(name='body'),
}

/**
 * @summary 取消发布任务
 *
 * @param request CancelPublishTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelPublishTaskResponse
 */
async function cancelPublishTaskWithOptions(request: CancelPublishTaskRequest, runtime: Util.RuntimeOptions): CancelPublishTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelPublishTask',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消发布任务
 *
 * @param request CancelPublishTaskRequest
 * @return CancelPublishTaskResponse
 */
async function cancelPublishTask(request: CancelPublishTaskRequest): CancelPublishTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelPublishTaskWithOptions(request, runtime);
}

model ChatRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  intentName?: string(name='IntentName'),
  knowledgeId?: string(name='KnowledgeId', example='30002406051'),
  perspective?: [ string ](name='Perspective'),
  sandBox?: boolean(name='SandBox', example='true'),
  senderId?: string(name='SenderId', example='custumer_123456'),
  senderNick?: string(name='SenderNick'),
  sessionId?: string(name='SessionId', example='9c6ebdc6e66f46ecadab3434314f6959'),
  utterance?: string(name='Utterance'),
  vendorParam?: string(name='VendorParam', example='{"phone":123456789}'),
}

model ChatShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  intentName?: string(name='IntentName'),
  knowledgeId?: string(name='KnowledgeId', example='30002406051'),
  perspectiveShrink?: string(name='Perspective'),
  sandBox?: boolean(name='SandBox', example='true'),
  senderId?: string(name='SenderId', example='custumer_123456'),
  senderNick?: string(name='SenderNick'),
  sessionId?: string(name='SessionId', example='9c6ebdc6e66f46ecadab3434314f6959'),
  utterance?: string(name='Utterance'),
  vendorParam?: string(name='VendorParam', example='{"phone":123456789}'),
}

model ChatResponseBody = {
  messageId?: string(name='MessageId', example='A2315C4B-A872-5DEE-9DAD-D73B194A4AEC'),
  messages?: [ 
    {
      answerSource?: string(name='AnswerSource', example='KNOWLEDGE'),
      answerType?: string(name='AnswerType', example='Text'),
      knowledge?: {
        answerSource?: string(name='AnswerSource', example='KnowledgeBase'),
        category?: string(name='Category'),
        content?: string(name='Content'),
        contentType?: string(name='ContentType', example='PLAIN_TEXT'),
        hitStatement?: string(name='HitStatement'),
        id?: string(name='Id', example='735898'),
        relatedKnowledges?: [ 
          {
            knowledgeId?: string(name='KnowledgeId', example='735899'),
            title?: string(name='Title'),
          }
        ](name='RelatedKnowledges'),
        score?: double(name='Score', example='0.998'),
        summary?: string(name='Summary'),
        title?: string(name='Title'),
      }(name='Knowledge'),
      recommends?: [ 
        {
          answerSource?: string(name='AnswerSource', example='KNOWLEDGE'),
          knowledgeId?: string(name='KnowledgeId', example='4548'),
          score?: double(name='Score', example='0.46'),
          title?: string(name='Title'),
        }
      ](name='Recommends'),
      text?: {
        answerSource?: string(name='AnswerSource', example='BotFramework'),
        articleTitle?: string(name='ArticleTitle'),
        commands?: map[string]any(name='Commands', example='{
	"sysToAgent": "{\\\\"skillGroup\\\\":\\\\"12\\\\"}"
}'),
        content?: string(name='Content'),
        contentType?: string(name='ContentType', example='PLAIN_TEXT'),
        dialogName?: string(name='DialogName'),
        ext?: map[string]any(name='Ext'),
        externalFlags?: map[string]any(name='ExternalFlags'),
        hitStatement?: string(name='HitStatement'),
        intentName?: string(name='IntentName'),
        metaData?: string(name='MetaData'),
        nodeId?: string(name='NodeId', example='1410-c7a72a78.__city'),
        nodeName?: string(name='NodeName'),
        responseType?: string(name='ResponseType', example='SSML'),
        score?: double(name='Score', example='100.0'),
        slots?: [ 
          {
            hit?: boolean(name='Hit', example='false'),
            name?: string(name='Name'),
            origin?: string(name='Origin'),
            value?: string(name='Value'),
          }
        ](name='Slots'),
        userDefinedChatTitle?: string(name='UserDefinedChatTitle'),
      }(name='Text'),
      title?: string(name='Title'),
      voiceTitle?: string(name='VoiceTitle'),
    }
  ](name='Messages'),
  querySegList?: [ string ](name='QuerySegList'),
  requestId?: string(name='RequestId', example='A2315C4B-A872-5DEE-9DAD-D73B194A4AEC'),
  sessionId?: string(name='SessionId', example='a6f216a0685c4c8baa0e8beb6d5ec6db'),
}

model ChatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChatResponseBody(name='body'),
}

/**
 * @summary 会话API
 *
 * @param tmpReq ChatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChatResponse
 */
async function chatWithOptions(tmpReq: ChatRequest, runtime: Util.RuntimeOptions): ChatResponse {
  Util.validateModel(tmpReq);
  var request = new ChatShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.perspective)) {
    request.perspectiveShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.perspective, 'Perspective', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentName)) {
    query['IntentName'] = request.intentName;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.perspectiveShrink)) {
    query['Perspective'] = request.perspectiveShrink;
  }
  if (!Util.isUnset(request.sandBox)) {
    query['SandBox'] = request.sandBox;
  }
  if (!Util.isUnset(request.senderId)) {
    query['SenderId'] = request.senderId;
  }
  if (!Util.isUnset(request.senderNick)) {
    query['SenderNick'] = request.senderNick;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.utterance)) {
    query['Utterance'] = request.utterance;
  }
  if (!Util.isUnset(request.vendorParam)) {
    query['VendorParam'] = request.vendorParam;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Chat',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 会话API
 *
 * @param request ChatRequest
 * @return ChatResponse
 */
async function chat(request: ChatRequest): ChatResponse {
  var runtime = new Util.RuntimeOptions{};
  return chatWithOptions(request, runtime);
}

model ContinueInstancePublishTaskRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  id?: long(name='Id', example='8521'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model ContinueInstancePublishTaskResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  errors?: map[string]any(name='Errors', example='{}'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_RUNNING'),
  warnings?: map[string]any(name='Warnings', example='{         "category_bind_faq": [             "以下类目没有发布到正式环境: 项目交付信息汇总"         ]     }'),
}

model ContinueInstancePublishTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ContinueInstancePublishTaskResponseBody(name='body'),
}

/**
 * @summary 继续机器人发布
 *
 * @param request ContinueInstancePublishTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ContinueInstancePublishTaskResponse
 */
async function continueInstancePublishTaskWithOptions(request: ContinueInstancePublishTaskRequest, runtime: Util.RuntimeOptions): ContinueInstancePublishTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ContinueInstancePublishTask',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 继续机器人发布
 *
 * @param request ContinueInstancePublishTaskRequest
 * @return ContinueInstancePublishTaskResponse
 */
async function continueInstancePublishTask(request: ContinueInstancePublishTaskRequest): ContinueInstancePublishTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return continueInstancePublishTaskWithOptions(request, runtime);
}

model CreateCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  bizCode?: string(name='BizCode'),
  knowledgeType?: int32(name='KnowledgeType'),
  name?: string(name='Name', description='This parameter is required.'),
  parentCategoryId?: long(name='ParentCategoryId', example='-1'),
}

model CreateCategoryResponseBody = {
  category?: {
    bizCode?: string(name='BizCode'),
    categoryId?: long(name='CategoryId', example='30000049006'),
    name?: string(name='Name'),
    parentCategoryId?: long(name='ParentCategoryId', example='-1'),
    status?: int32(name='Status', example='0'),
  }(name='Category'),
  requestId?: string(name='RequestId', example='A629A28F-F25E-5572-A679-FA46FB0151D6'),
}

model CreateCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCategoryResponseBody(name='body'),
}

/**
 * @summary 新增类目
 *
 * @param request CreateCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCategoryResponse
 */
async function createCategoryWithOptions(request: CreateCategoryRequest, runtime: Util.RuntimeOptions): CreateCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizCode)) {
    body['BizCode'] = request.bizCode;
  }
  if (!Util.isUnset(request.knowledgeType)) {
    body['KnowledgeType'] = request.knowledgeType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.parentCategoryId)) {
    body['ParentCategoryId'] = request.parentCategoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCategory',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新增类目
 *
 * @param request CreateCategoryRequest
 * @return CreateCategoryResponse
 */
async function createCategory(request: CreateCategoryRequest): CreateCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCategoryWithOptions(request, runtime);
}

model CreateConnQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  connQuestionId?: long(name='ConnQuestionId', description='This parameter is required.', example='30002654628'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30002174773'),
}

model CreateConnQuestionResponseBody = {
  outlineId?: long(name='OutlineId', example='1000002123'),
  requestId?: string(name='RequestId', example='C191B48B-9268-4FB1-A3C2-5143B4A91D0C'),
}

model CreateConnQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateConnQuestionResponseBody(name='body'),
}

/**
 * @summary 新建FAQ关联问
 *
 * @param request CreateConnQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateConnQuestionResponse
 */
async function createConnQuestionWithOptions(request: CreateConnQuestionRequest, runtime: Util.RuntimeOptions): CreateConnQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.connQuestionId)) {
    body['ConnQuestionId'] = request.connQuestionId;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateConnQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新建FAQ关联问
 *
 * @param request CreateConnQuestionRequest
 * @return CreateConnQuestionResponse
 */
async function createConnQuestion(request: CreateConnQuestionRequest): CreateConnQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createConnQuestionWithOptions(request, runtime);
}

model CreateDSEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityName?: string(name='EntityName', description='This parameter is required.', example='实体名称'),
  entityType?: string(name='EntityType', example='synonyms'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
}

model CreateDSEntityResponseBody = {
  entityId?: long(name='EntityId', example='23436345'),
  requestId?: string(name='RequestId', example='adfad2343f1f2r'),
}

model CreateDSEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDSEntityResponseBody(name='body'),
}

/**
 * @summary 实体-创建
 *
 * @param request CreateDSEntityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDSEntityResponse
 */
async function createDSEntityWithOptions(request: CreateDSEntityRequest, runtime: Util.RuntimeOptions): CreateDSEntityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityName)) {
    query['EntityName'] = request.entityName;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDSEntity',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体-创建
 *
 * @param request CreateDSEntityRequest
 * @return CreateDSEntityResponse
 */
async function createDSEntity(request: CreateDSEntityRequest): CreateDSEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDSEntityWithOptions(request, runtime);
}

model CreateDSEntityValueRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', description='This parameter is required.', example='ada'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='12'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  synonyms?: [ string ](name='Synonyms'),
}

model CreateDSEntityValueShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', description='This parameter is required.', example='ada'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='12'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  synonymsShrink?: string(name='Synonyms'),
}

model CreateDSEntityValueResponseBody = {
  entityValueId?: long(name='EntityValueId', example='2434543453'),
  requestId?: string(name='RequestId', example='g763hg48j3f3'),
}

model CreateDSEntityValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDSEntityValueResponseBody(name='body'),
}

/**
 * @summary 实体成员-创建
 *
 * @param tmpReq CreateDSEntityValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDSEntityValueResponse
 */
async function createDSEntityValueWithOptions(tmpReq: CreateDSEntityValueRequest, runtime: Util.RuntimeOptions): CreateDSEntityValueResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDSEntityValueShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.synonyms)) {
    request.synonymsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.synonyms, 'Synonyms', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.synonymsShrink)) {
    body['Synonyms'] = request.synonymsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDSEntityValue',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体成员-创建
 *
 * @param request CreateDSEntityValueRequest
 * @return CreateDSEntityValueResponse
 */
async function createDSEntityValue(request: CreateDSEntityValueRequest): CreateDSEntityValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDSEntityValueWithOptions(request, runtime);
}

model CreateDocRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='30000049006'),
  config?: string(name='Config', example='{"Splitter":"treeSplitter","ChunkSize":500,"TreePatterns":["^# .*","^## .*","^### .*","^#### .*"],"TitleSource":""}'),
  content?: string(name='Content'),
  docMetadata?: [ 
    {
      businessViewId?: string(name='BusinessViewId'),
      businessViewName?: string(name='BusinessViewName'),
      metaCellInfoDTOList?: [ 
        {
          fieldCode?: string(name='FieldCode'),
          fieldName?: string(name='FieldName'),
          value?: string(name='Value'),
        }
      ](name='MetaCellInfoDTOList'),
    }
  ](name='DocMetadata'),
  endDate?: string(name='EndDate', example='2032-05-25T16:28:36Z'),
  meta?: string(name='Meta', example='{"code":"xxx"}'),
  startDate?: string(name='StartDate', example='2022-05-25T16:28:36Z'),
  tagIds?: [ long ](name='TagIds'),
  title?: string(name='Title', description='This parameter is required.'),
  url?: string(name='Url', example='https://example.com/example.pdf'),
}

model CreateDocShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='30000049006'),
  config?: string(name='Config', example='{"Splitter":"treeSplitter","ChunkSize":500,"TreePatterns":["^# .*","^## .*","^### .*","^#### .*"],"TitleSource":""}'),
  content?: string(name='Content'),
  docMetadataShrink?: string(name='DocMetadata'),
  endDate?: string(name='EndDate', example='2032-05-25T16:28:36Z'),
  meta?: string(name='Meta', example='{"code":"xxx"}'),
  startDate?: string(name='StartDate', example='2022-05-25T16:28:36Z'),
  tagIdsShrink?: string(name='TagIds'),
  title?: string(name='Title', description='This parameter is required.'),
  url?: string(name='Url', example='https://example.com/example.pdf'),
}

model CreateDocResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30001905617'),
  requestId?: string(name='RequestId', example='07B270A4-61D8-57F6-A609-A3C216CFB872'),
}

model CreateDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDocResponseBody(name='body'),
}

/**
 * @summary 创建文档
 *
 * @param tmpReq CreateDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDocResponse
 */
async function createDocWithOptions(tmpReq: CreateDocRequest, runtime: Util.RuntimeOptions): CreateDocResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDocShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.docMetadata)) {
    request.docMetadataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docMetadata, 'DocMetadata', 'json');
  }
  if (!Util.isUnset(tmpReq.tagIds)) {
    request.tagIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagIds, 'TagIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.config)) {
    query['Config'] = request.config;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.docMetadataShrink)) {
    query['DocMetadata'] = request.docMetadataShrink;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.meta)) {
    query['Meta'] = request.meta;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.tagIdsShrink)) {
    query['TagIds'] = request.tagIdsShrink;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.url)) {
    query['Url'] = request.url;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDoc',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建文档
 *
 * @param request CreateDocRequest
 * @return CreateDocResponse
 */
async function createDoc(request: CreateDocRequest): CreateDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDocWithOptions(request, runtime);
}

model CreateFaqRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='1000053274'),
  endDate?: string(name='EndDate', example='2030-12-31T16:00:00Z'),
  solutionContent?: string(name='SolutionContent'),
  solutionType?: int32(name='SolutionType', example='0'),
  startDate?: string(name='StartDate', example='2022-05-25T16:28:36Z'),
  title?: string(name='Title', description='This parameter is required.'),
}

model CreateFaqResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30001979424'),
  requestId?: string(name='RequestId', example='28805A7C-D695-548C-A31B-67E52C2C274F'),
}

model CreateFaqResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFaqResponseBody(name='body'),
}

/**
 * @summary 新建FAQ
 *
 * @param request CreateFaqRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFaqResponse
 */
async function createFaqWithOptions(request: CreateFaqRequest, runtime: Util.RuntimeOptions): CreateFaqResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.endDate)) {
    body['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.solutionContent)) {
    body['SolutionContent'] = request.solutionContent;
  }
  if (!Util.isUnset(request.solutionType)) {
    body['SolutionType'] = request.solutionType;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFaq',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新建FAQ
 *
 * @param request CreateFaqRequest
 * @return CreateFaqResponse
 */
async function createFaq(request: CreateFaqRequest): CreateFaqResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFaqWithOptions(request, runtime);
}

model CreateInstanceRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  introduction?: string(name='Introduction', example='用于手机app的小蜜机器人'),
  languageCode?: string(name='LanguageCode', example='zh-cn'),
  name?: string(name='Name', example='小蜜机器人'),
  robotType?: string(name='RobotType', example='scenario_im'),
}

model CreateInstanceResponseBody = {
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  requestId?: string(name='RequestId', description='Id of the request', example='F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

/**
 * @summary 机器人-创建
 *
 * @param request CreateInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResponse
 */
async function createInstanceWithOptions(request: CreateInstanceRequest, runtime: Util.RuntimeOptions): CreateInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.introduction)) {
    query['Introduction'] = request.introduction;
  }
  if (!Util.isUnset(request.languageCode)) {
    query['LanguageCode'] = request.languageCode;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.robotType)) {
    query['RobotType'] = request.robotType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstance',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 机器人-创建
 *
 * @param request CreateInstanceRequest
 * @return CreateInstanceResponse
 */
async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createInstanceWithOptions(request, runtime);
}

model CreateInstancePublishTaskRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model CreateInstancePublishTaskResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_RUNNING'),
}

model CreateInstancePublishTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstancePublishTaskResponseBody(name='body'),
}

/**
 * @summary 创建机器人发布任务
 *
 * @param request CreateInstancePublishTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstancePublishTaskResponse
 */
async function createInstancePublishTaskWithOptions(request: CreateInstancePublishTaskRequest, runtime: Util.RuntimeOptions): CreateInstancePublishTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstancePublishTask',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建机器人发布任务
 *
 * @param request CreateInstancePublishTaskRequest
 * @return CreateInstancePublishTaskResponse
 */
async function createInstancePublishTask(request: CreateInstancePublishTaskRequest): CreateInstancePublishTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createInstancePublishTaskWithOptions(request, runtime);
}

model CreateIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentDefinition?: {
    aliasName?: string(name='AliasName'),
    intentName?: string(name='IntentName', description='This parameter is required.'),
    slotInfos?: [ 
      {
        array?: boolean(name='Array', example='false'),
        encrypt?: boolean(name='Encrypt', example='false'),
        interactive?: boolean(name='Interactive', example='false'),
        name?: string(name='Name', description='This parameter is required.'),
        slotId?: string(name='SlotId', description='This parameter is required.', example='fg452dfg3df23'),
        value?: string(name='Value', description='This parameter is required.'),
      }
    ](name='SlotInfos'),
  }(name='IntentDefinition'),
}

model CreateIntentShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentDefinitionShrink?: string(name='IntentDefinition'),
}

model CreateIntentResponseBody = {
  intentId?: long(name='IntentId', example='43546474'),
  requestId?: string(name='RequestId', example='df56gjh5et34g3g3'),
}

model CreateIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIntentResponseBody(name='body'),
}

/**
 * @summary 意图-创建
 *
 * @param tmpReq CreateIntentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIntentResponse
 */
async function createIntentWithOptions(tmpReq: CreateIntentRequest, runtime: Util.RuntimeOptions): CreateIntentResponse {
  Util.validateModel(tmpReq);
  var request = new CreateIntentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.intentDefinition)) {
    request.intentDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.intentDefinition, 'IntentDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentDefinitionShrink)) {
    query['IntentDefinition'] = request.intentDefinitionShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateIntent',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-创建
 *
 * @param request CreateIntentRequest
 * @return CreateIntentResponse
 */
async function createIntent(request: CreateIntentRequest): CreateIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIntentWithOptions(request, runtime);
}

model CreateLgfRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  lgfDefinition?: {
    intentId?: long(name='IntentId', description='This parameter is required.', example='4675678567'),
    ruleText?: string(name='RuleText', description='This parameter is required.'),
  }(name='LgfDefinition'),
}

model CreateLgfShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  lgfDefinitionShrink?: string(name='LgfDefinition'),
}

model CreateLgfResponseBody = {
  lgfId?: long(name='LgfId', description='LGF ID', example='123453433453'),
  requestId?: string(name='RequestId', example='af5fg3sdf457j5'),
}

model CreateLgfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLgfResponseBody(name='body'),
}

/**
 * @summary 意图-LGF-创建
 *
 * @param tmpReq CreateLgfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLgfResponse
 */
async function createLgfWithOptions(tmpReq: CreateLgfRequest, runtime: Util.RuntimeOptions): CreateLgfResponse {
  Util.validateModel(tmpReq);
  var request = new CreateLgfShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.lgfDefinition)) {
    request.lgfDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.lgfDefinition, 'LgfDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lgfDefinitionShrink)) {
    query['LgfDefinition'] = request.lgfDefinitionShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateLgf',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-LGF-创建
 *
 * @param request CreateLgfRequest
 * @return CreateLgfResponse
 */
async function createLgf(request: CreateLgfRequest): CreateLgfResponse {
  var runtime = new Util.RuntimeOptions{};
  return createLgfWithOptions(request, runtime);
}

model CreatePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  description?: string(name='Description', example='用于购物APP的移动端视角'),
  name?: string(name='Name', example='移动端视角'),
}

model CreatePerspectiveResponseBody = {
  perspectiveId?: string(name='PerspectiveId', example='3001'),
  requestId?: string(name='RequestId', example='F285D735-D580-18A8-B97F-B2E72B00F101'),
}

model CreatePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePerspectiveResponseBody(name='body'),
}

/**
 * @summary 视角-创建
 *
 * @param request CreatePerspectiveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePerspectiveResponse
 */
async function createPerspectiveWithOptions(request: CreatePerspectiveRequest, runtime: Util.RuntimeOptions): CreatePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePerspective',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视角-创建
 *
 * @param request CreatePerspectiveRequest
 * @return CreatePerspectiveResponse
 */
async function createPerspective(request: CreatePerspectiveRequest): CreatePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPerspectiveWithOptions(request, runtime);
}

model CreatePublishTaskRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  bizType?: string(name='BizType', example='faq'),
  dataIdList?: [ string ](name='DataIdList', example='["8521"]'),
}

model CreatePublishTaskShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  bizType?: string(name='BizType', example='faq'),
  dataIdListShrink?: string(name='DataIdList', example='["8521"]'),
}

model CreatePublishTaskResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_RUNNING'),
}

model CreatePublishTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePublishTaskResponseBody(name='body'),
}

/**
 * @summary 创建发布任务
 *
 * @param tmpReq CreatePublishTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePublishTaskResponse
 */
async function createPublishTaskWithOptions(tmpReq: CreatePublishTaskRequest, runtime: Util.RuntimeOptions): CreatePublishTaskResponse {
  Util.validateModel(tmpReq);
  var request = new CreatePublishTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.dataIdList)) {
    request.dataIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dataIdList, 'DataIdList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.dataIdListShrink)) {
    query['DataIdList'] = request.dataIdListShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePublishTask',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建发布任务
 *
 * @param request CreatePublishTaskRequest
 * @return CreatePublishTaskResponse
 */
async function createPublishTask(request: CreatePublishTaskRequest): CreatePublishTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPublishTaskWithOptions(request, runtime);
}

model CreateSimQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
  title?: string(name='Title', description='This parameter is required.'),
}

model CreateSimQuestionResponseBody = {
  requestId?: string(name='RequestId', example='16AC1B3C-66E0-438B-BB7C-71B692407B67'),
  simQuestionId?: long(name='SimQuestionId', example='1000002788'),
}

model CreateSimQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSimQuestionResponseBody(name='body'),
}

/**
 * @summary 新建FAQ相似问
 *
 * @param request CreateSimQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSimQuestionResponse
 */
async function createSimQuestionWithOptions(request: CreateSimQuestionRequest, runtime: Util.RuntimeOptions): CreateSimQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSimQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新建FAQ相似问
 *
 * @param request CreateSimQuestionRequest
 * @return CreateSimQuestionResponse
 */
async function createSimQuestion(request: CreateSimQuestionRequest): CreateSimQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSimQuestionWithOptions(request, runtime);
}

model CreateSolutionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', description='This parameter is required.'),
  contentType?: int32(name='ContentType', example='1'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
  perspectiveCodes?: [ string ](name='PerspectiveCodes', description='This parameter is required.'),
}

model CreateSolutionResponseBody = {
  requestId?: string(name='RequestId', example='F55D90C1-31BE-4B2A-AA3F-25EFC36F9419'),
  solutionId?: long(name='SolutionId', example='100001089003'),
}

model CreateSolutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSolutionResponseBody(name='body'),
}

/**
 * @summary 新建FAQ答案
 *
 * @param request CreateSolutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSolutionResponse
 */
async function createSolutionWithOptions(request: CreateSolutionRequest, runtime: Util.RuntimeOptions): CreateSolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.contentType)) {
    query['ContentType'] = request.contentType;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.perspectiveCodes)) {
    query['PerspectiveCodes'] = request.perspectiveCodes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSolution',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新建FAQ答案
 *
 * @param request CreateSolutionRequest
 * @return CreateSolutionResponse
 */
async function createSolution(request: CreateSolutionRequest): CreateSolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSolutionWithOptions(request, runtime);
}

model CreateUserSayRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  userSayDefinition?: {
    content?: string(name='Content', description='This parameter is required.'),
    intentId?: long(name='IntentId', description='This parameter is required.', example='123232'),
    slotInfos?: [ 
      {
        endIndex?: int32(name='EndIndex', example='6'),
        slotId?: string(name='SlotId', example='fb34adf2fv43f2'),
        startIndex?: int32(name='StartIndex', example='4'),
      }
    ](name='SlotInfos'),
  }(name='UserSayDefinition'),
}

model CreateUserSayShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  userSayDefinitionShrink?: string(name='UserSayDefinition'),
}

model CreateUserSayResponseBody = {
  requestId?: string(name='RequestId', example='8g4n8bnd236fg79'),
  userSayId?: long(name='UserSayId', example='46456176856'),
}

model CreateUserSayResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserSayResponseBody(name='body'),
}

/**
 * @summary 意图-话术-创建
 *
 * @param tmpReq CreateUserSayRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUserSayResponse
 */
async function createUserSayWithOptions(tmpReq: CreateUserSayRequest, runtime: Util.RuntimeOptions): CreateUserSayResponse {
  Util.validateModel(tmpReq);
  var request = new CreateUserSayShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.userSayDefinition)) {
    request.userSayDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userSayDefinition, 'UserSayDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.userSayDefinitionShrink)) {
    query['UserSayDefinition'] = request.userSayDefinitionShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateUserSay',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-话术-创建
 *
 * @param request CreateUserSayRequest
 * @return CreateUserSayResponse
 */
async function createUserSay(request: CreateUserSayRequest): CreateUserSayResponse {
  var runtime = new Util.RuntimeOptions{};
  return createUserSayWithOptions(request, runtime);
}

model DeleteCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='30000049006'),
}

model DeleteCategoryResponseBody = {
  requestId?: string(name='RequestId', example='4B3E0DE3-DC57-5BFE-88D4-ADD8ED024F55'),
}

model DeleteCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCategoryResponseBody(name='body'),
}

/**
 * @summary 删除类目
 *
 * @param request DeleteCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCategoryResponse
 */
async function deleteCategoryWithOptions(request: DeleteCategoryRequest, runtime: Util.RuntimeOptions): DeleteCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCategory',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除类目
 *
 * @param request DeleteCategoryRequest
 * @return DeleteCategoryResponse
 */
async function deleteCategory(request: DeleteCategoryRequest): DeleteCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCategoryWithOptions(request, runtime);
}

model DeleteConnQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  outlineId?: long(name='OutlineId', description='This parameter is required.', example='877397683'),
}

model DeleteConnQuestionResponseBody = {
  requestId?: string(name='RequestId', example='FC323352-3AD7-59A1-9088-A64470BAFC9D'),
}

model DeleteConnQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteConnQuestionResponseBody(name='body'),
}

/**
 * @summary 删除FAQ关联问
 *
 * @param request DeleteConnQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteConnQuestionResponse
 */
async function deleteConnQuestionWithOptions(request: DeleteConnQuestionRequest, runtime: Util.RuntimeOptions): DeleteConnQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.outlineId)) {
    body['OutlineId'] = request.outlineId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteConnQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除FAQ关联问
 *
 * @param request DeleteConnQuestionRequest
 * @return DeleteConnQuestionResponse
 */
async function deleteConnQuestion(request: DeleteConnQuestionRequest): DeleteConnQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteConnQuestionWithOptions(request, runtime);
}

model DeleteDSEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='123'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
}

model DeleteDSEntityResponseBody = {
  entityId?: long(name='EntityId', example='123'),
  requestId?: string(name='RequestId', example='4dfghf56235asdf452'),
}

model DeleteDSEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDSEntityResponseBody(name='body'),
}

/**
 * @summary 实体-删除
 *
 * @param request DeleteDSEntityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDSEntityResponse
 */
async function deleteDSEntityWithOptions(request: DeleteDSEntityRequest, runtime: Util.RuntimeOptions): DeleteDSEntityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDSEntity',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体-删除
 *
 * @param request DeleteDSEntityRequest
 * @return DeleteDSEntityResponse
 */
async function deleteDSEntity(request: DeleteDSEntityRequest): DeleteDSEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDSEntityWithOptions(request, runtime);
}

model DeleteDSEntityValueRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='345346223452'),
  entityValueId?: long(name='EntityValueId', description='This parameter is required.', example='3453453452'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
}

model DeleteDSEntityValueResponseBody = {
  entityValueId?: long(name='EntityValueId', example='3453453452'),
  requestId?: string(name='RequestId', example='dfdf2t3rfvb45y'),
}

model DeleteDSEntityValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDSEntityValueResponseBody(name='body'),
}

/**
 * @summary 实体成员-删除
 *
 * @param request DeleteDSEntityValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDSEntityValueResponse
 */
async function deleteDSEntityValueWithOptions(request: DeleteDSEntityValueRequest, runtime: Util.RuntimeOptions): DeleteDSEntityValueResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.entityValueId)) {
    query['EntityValueId'] = request.entityValueId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDSEntityValue',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体成员-删除
 *
 * @param request DeleteDSEntityValueRequest
 * @return DeleteDSEntityValueResponse
 */
async function deleteDSEntityValue(request: DeleteDSEntityValueRequest): DeleteDSEntityValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDSEntityValueWithOptions(request, runtime);
}

model DeleteDocRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617', nullable=false),
}

model DeleteDocResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30002406051'),
  requestId?: string(name='RequestId', example='DFB71B34-4188-4EA2-9988-EF3014E75910'),
}

model DeleteDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDocResponseBody(name='body'),
}

/**
 * @summary 文档删除
 *
 * @param request DeleteDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDocResponse
 */
async function deleteDocWithOptions(request: DeleteDocRequest, runtime: Util.RuntimeOptions): DeleteDocResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDoc',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档删除
 *
 * @param request DeleteDocRequest
 * @return DeleteDocResponse
 */
async function deleteDoc(request: DeleteDocRequest): DeleteDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDocWithOptions(request, runtime);
}

model DeleteFaqRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
}

model DeleteFaqResponseBody = {
  requestId?: string(name='RequestId', example='F79E7305-5314-5069-A701-9591AD051902'),
}

model DeleteFaqResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaqResponseBody(name='body'),
}

/**
 * @summary 删除FAQ，如果是已发布的知识，删除之后，变成已删除未发布，需要发布才能真正删除
 *
 * @param request DeleteFaqRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFaqResponse
 */
async function deleteFaqWithOptions(request: DeleteFaqRequest, runtime: Util.RuntimeOptions): DeleteFaqResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFaq',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除FAQ，如果是已发布的知识，删除之后，变成已删除未发布，需要发布才能真正删除
 *
 * @param request DeleteFaqRequest
 * @return DeleteFaqResponse
 */
async function deleteFaq(request: DeleteFaqRequest): DeleteFaqResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFaqWithOptions(request, runtime);
}

model DeleteInstanceRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model DeleteInstanceResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2021-09-11T09:26:14Z'),
  createUserId?: long(name='CreateUserId', example='9052'),
  createUserName?: string(name='CreateUserName', example='xuqiang_test'),
  error?: string(name='Error'),
  id?: long(name='Id', example='8521'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: long(name='Response', example='8521'),
  status?: string(name='Status', example='FE_RUNNING'),
}

model DeleteInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInstanceResponseBody(name='body'),
}

/**
 * @summary 机器人-删除
 *
 * @param request DeleteInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInstanceResponse
 */
async function deleteInstanceWithOptions(request: DeleteInstanceRequest, runtime: Util.RuntimeOptions): DeleteInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteInstance',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 机器人-删除
 *
 * @param request DeleteInstanceRequest
 * @return DeleteInstanceResponse
 */
async function deleteInstance(request: DeleteInstanceRequest): DeleteInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteInstanceWithOptions(request, runtime);
}

model DeleteIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='12345'),
}

model DeleteIntentResponseBody = {
  intentId?: long(name='IntentId', example='12345'),
  requestId?: string(name='RequestId', example='3464dfg3qwr34tf34'),
}

model DeleteIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIntentResponseBody(name='body'),
}

/**
 * @summary 意图-删除
 *
 * @param request DeleteIntentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIntentResponse
 */
async function deleteIntentWithOptions(request: DeleteIntentRequest, runtime: Util.RuntimeOptions): DeleteIntentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIntent',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-删除
 *
 * @param request DeleteIntentRequest
 * @return DeleteIntentResponse
 */
async function deleteIntent(request: DeleteIntentRequest): DeleteIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIntentWithOptions(request, runtime);
}

model DeleteLgfRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='23242342'),
  lgfId?: long(name='LgfId', description='lgf Id

This parameter is required.', example='2342424'),
}

model DeleteLgfResponseBody = {
  lgfId?: long(name='LgfId', description='LGF ID', example='2342424'),
  requestId?: string(name='RequestId', example='dgw2342424qw42'),
}

model DeleteLgfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLgfResponseBody(name='body'),
}

/**
 * @summary 意图-LGF-删除
 *
 * @param request DeleteLgfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLgfResponse
 */
async function deleteLgfWithOptions(request: DeleteLgfRequest, runtime: Util.RuntimeOptions): DeleteLgfResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  if (!Util.isUnset(request.lgfId)) {
    query['LgfId'] = request.lgfId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLgf',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-LGF-删除
 *
 * @param request DeleteLgfRequest
 * @return DeleteLgfResponse
 */
async function deleteLgf(request: DeleteLgfRequest): DeleteLgfResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLgfWithOptions(request, runtime);
}

model DeletePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  perspectiveId?: string(name='PerspectiveId', example='3001'),
}

model DeletePerspectiveResponseBody = {
  requestId?: string(name='RequestId', example='FC384CE1-8D42-1900-84E1-F33F990F2B5E'),
  result?: boolean(name='Result', example='true'),
}

model DeletePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePerspectiveResponseBody(name='body'),
}

/**
 * @summary 视角-删除
 *
 * @param request DeletePerspectiveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePerspectiveResponse
 */
async function deletePerspectiveWithOptions(request: DeletePerspectiveRequest, runtime: Util.RuntimeOptions): DeletePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePerspective',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视角-删除
 *
 * @param request DeletePerspectiveRequest
 * @return DeletePerspectiveResponse
 */
async function deletePerspective(request: DeletePerspectiveRequest): DeletePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePerspectiveWithOptions(request, runtime);
}

model DeleteSimQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  simQuestionId?: long(name='SimQuestionId', description='This parameter is required.', example='1000002788'),
}

model DeleteSimQuestionResponseBody = {
  requestId?: string(name='RequestId', example='6419BA93-D111-5225-8998-13E63E6D3940'),
}

model DeleteSimQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSimQuestionResponseBody(name='body'),
}

/**
 * @summary 删除FAQ相似问
 *
 * @param request DeleteSimQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSimQuestionResponse
 */
async function deleteSimQuestionWithOptions(request: DeleteSimQuestionRequest, runtime: Util.RuntimeOptions): DeleteSimQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.simQuestionId)) {
    body['SimQuestionId'] = request.simQuestionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSimQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除FAQ相似问
 *
 * @param request DeleteSimQuestionRequest
 * @return DeleteSimQuestionResponse
 */
async function deleteSimQuestion(request: DeleteSimQuestionRequest): DeleteSimQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSimQuestionWithOptions(request, runtime);
}

model DeleteSolutionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  solutionId?: long(name='SolutionId', description='This parameter is required.', example='100001321580'),
}

model DeleteSolutionResponseBody = {
  requestId?: string(name='RequestId', example='F79E7305-5314-5069-A701-9591AD051902'),
}

model DeleteSolutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSolutionResponseBody(name='body'),
}

/**
 * @summary 删除FAQ答案
 *
 * @param request DeleteSolutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSolutionResponse
 */
async function deleteSolutionWithOptions(request: DeleteSolutionRequest, runtime: Util.RuntimeOptions): DeleteSolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.solutionId)) {
    body['SolutionId'] = request.solutionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSolution',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除FAQ答案
 *
 * @param request DeleteSolutionRequest
 * @return DeleteSolutionResponse
 */
async function deleteSolution(request: DeleteSolutionRequest): DeleteSolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSolutionWithOptions(request, runtime);
}

model DeleteUserSayRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='343df2sdf23'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='5564564546'),
  userSayId?: long(name='UserSayId', description='This parameter is required.', example='4562121234'),
}

model DeleteUserSayResponseBody = {
  requestId?: string(name='RequestId', example='dfgdg324gf34t34g34g3'),
  userSayId?: long(name='UserSayId', example='4562121234'),
}

model DeleteUserSayResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserSayResponseBody(name='body'),
}

/**
 * @summary 意图-用户话术-删除
 *
 * @param request DeleteUserSayRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserSayResponse
 */
async function deleteUserSayWithOptions(request: DeleteUserSayRequest, runtime: Util.RuntimeOptions): DeleteUserSayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  if (!Util.isUnset(request.userSayId)) {
    query['UserSayId'] = request.userSayId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserSay',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-用户话术-删除
 *
 * @param request DeleteUserSayRequest
 * @return DeleteUserSayResponse
 */
async function deleteUserSay(request: DeleteUserSayRequest): DeleteUserSayResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserSayWithOptions(request, runtime);
}

model DescribeCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='30000049006'),
}

model DescribeCategoryResponseBody = {
  category?: {
    bizCode?: string(name='BizCode'),
    categoryId?: long(name='CategoryId', example='30000049006'),
    name?: string(name='Name'),
    parentCategoryId?: long(name='ParentCategoryId', example='-1'),
    status?: int32(name='Status', example='0'),
  }(name='Category'),
  requestId?: string(name='RequestId', example='2B0304FD-3804-5C06-9A83-77F5523664AF'),
}

model DescribeCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCategoryResponseBody(name='body'),
}

/**
 * @summary 查看单个类目信息
 *
 * @param request DescribeCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCategoryResponse
 */
async function describeCategoryWithOptions(request: DescribeCategoryRequest, runtime: Util.RuntimeOptions): DescribeCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCategory',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看单个类目信息
 *
 * @param request DescribeCategoryRequest
 * @return DescribeCategoryResponse
 */
async function describeCategory(request: DescribeCategoryRequest): DescribeCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCategoryWithOptions(request, runtime);
}

model DescribeDSEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='123'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
}

model DescribeDSEntityResponseBody = {
  createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
  createUserId?: string(name='CreateUserId', example='123231'),
  createUserName?: string(name='CreateUserName', example='test'),
  entityId?: long(name='EntityId', example='123'),
  entityName?: string(name='EntityName'),
  entityType?: string(name='EntityType', example='synonyms'),
  modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
  modifyUserId?: string(name='ModifyUserId', example='123231'),
  modifyUserName?: string(name='ModifyUserName', example='test'),
  requestId?: string(name='RequestId', example='ad23234dsf234fga'),
  sysEntityCode?: string(name='SysEntityCode'),
}

model DescribeDSEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDSEntityResponseBody(name='body'),
}

/**
 * @summary 实体-详情
 *
 * @param request DescribeDSEntityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDSEntityResponse
 */
async function describeDSEntityWithOptions(request: DescribeDSEntityRequest, runtime: Util.RuntimeOptions): DescribeDSEntityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDSEntity',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体-详情
 *
 * @param request DescribeDSEntityRequest
 * @return DescribeDSEntityResponse
 */
async function describeDSEntity(request: DescribeDSEntityRequest): DescribeDSEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDSEntityWithOptions(request, runtime);
}

model DescribeDocRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001979424'),
  showDetail?: boolean(name='ShowDetail', example='false'),
}

model DescribeDocResponseBody = {
  bizCode?: string(name='BizCode', example='bizcode123'),
  categoryId?: long(name='CategoryId', example='30000049006'),
  config?: string(name='Config', example='{"Splitter":"treeSplitter","ChunkSize":500,"TreePatterns":["^# .*","^## .*","^### .*","^#### .*"],"TitleSource":"docName"}'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  createUserId?: long(name='CreateUserId', example='1111111111'),
  createUserName?: string(name='CreateUserName'),
  docInfo?: {
    docParas?: [ 
      {
        paraLevel?: int32(name='ParaLevel', example='1'),
        paraNo?: int32(name='ParaNo', example='1'),
        paraText?: string(name='ParaText'),
        paraType?: string(name='ParaType', example='text'),
      }
    ](name='DocParas'),
  }(name='DocInfo'),
  docMetadata?: [ 
    {
      businessViewId?: string(name='BusinessViewId'),
      businessViewName?: string(name='BusinessViewName'),
      metaCellInfoDTOList?: [ 
        {
          fieldCode?: string(name='FieldCode'),
          fieldName?: string(name='FieldName'),
          value?: string(name='Value'),
        }
      ](name='MetaCellInfoDTOList'),
    }
  ](name='DocMetadata'),
  docName?: string(name='DocName'),
  docTags?: [ 
    {
      defaultTag?: boolean(name='DefaultTag'),
      groupId?: long(name='GroupId'),
      groupName?: string(name='GroupName'),
      tagId?: long(name='TagId'),
      tagName?: string(name='TagName'),
    }
  ](name='DocTags'),
  effectStatus?: int32(name='EffectStatus', example='20'),
  endDate?: string(name='EndDate', example='2023-04-27T06:08:54Z'),
  knowledgeId?: long(name='KnowledgeId', example='30001979424'),
  meta?: string(name='Meta', example='{"code":"xxx"}'),
  modifyTime?: string(name='ModifyTime', example='2020-11-25T08:56:55Z'),
  modifyUserId?: long(name='ModifyUserId', example='2222222222'),
  modifyUserName?: string(name='ModifyUserName'),
  processCanRetry?: boolean(name='ProcessCanRetry', example='true'),
  processMessage?: string(name='ProcessMessage'),
  processStatus?: int32(name='ProcessStatus', example='0'),
  requestId?: string(name='RequestId', description='Id of the request', example='7F132693-212A-40A9-8A81-11E7694E478B'),
  startDate?: string(name='StartDate', example='1979-12-31T16:00:00Z'),
  status?: int32(name='Status', example='1'),
  title?: string(name='Title'),
  url?: string(name='Url'),
}

model DescribeDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDocResponseBody(name='body'),
}

/**
 * @summary 文档详情
 *
 * @param request DescribeDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDocResponse
 */
async function describeDocWithOptions(request: DescribeDocRequest, runtime: Util.RuntimeOptions): DescribeDocResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.showDetail)) {
    query['ShowDetail'] = request.showDetail;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDoc',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档详情
 *
 * @param request DescribeDocRequest
 * @return DescribeDocResponse
 */
async function describeDoc(request: DescribeDocRequest): DescribeDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDocWithOptions(request, runtime);
}

model DescribeFaqRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001979424'),
}

model DescribeFaqResponseBody = {
  categoryId?: long(name='CategoryId', example='30000055617'),
  createTime?: string(name='CreateTime', example='2020-11-30T03:03:37Z'),
  createUserName?: string(name='CreateUserName', example='test01'),
  effectStatus?: int32(name='EffectStatus', example='20'),
  endDate?: string(name='EndDate', example='2023-04-27T06:08:54Z'),
  knowledgeId?: long(name='KnowledgeId', example='30001979424'),
  modifyTime?: string(name='ModifyTime', example='2020-12-02T06:35:50Z'),
  modifyUserName?: string(name='ModifyUserName', example='test01'),
  outlines?: [ 
    {
      connQuestionId?: long(name='ConnQuestionId', example='1000098002'),
      createTime?: string(name='CreateTime', example='2022-05-26T10:24:00Z'),
      modifyTime?: string(name='ModifyTime', example='2022-05-26T18:12:02Z'),
      outlineId?: long(name='OutlineId', example='797'),
      title?: string(name='Title'),
    }
  ](name='Outlines'),
  requestId?: string(name='RequestId', example='8AD9FA10-7780-5E12-B701-13C928524F32'),
  simQuestions?: [ 
    {
      createTime?: string(name='CreateTime', example='2022-05-26T10:24:00Z'),
      modifyTime?: string(name='ModifyTime', example='2022-05-29T03:55:07Z'),
      simQuestionId?: long(name='SimQuestionId', example='10000000581'),
      title?: string(name='Title'),
    }
  ](name='SimQuestions'),
  solutions?: [ 
    {
      content?: string(name='Content'),
      contentType?: int32(name='ContentType', example='0'),
      createTime?: string(name='CreateTime', example='2022-05-26T10:24:00Z'),
      modifyTime?: string(name='ModifyTime', example='2022-05-29T07:07:13Z'),
      perspectiveCodes?: [ string ](name='PerspectiveCodes'),
      plainText?: string(name='PlainText'),
      solutionId?: long(name='SolutionId', example='10000003071'),
    }
  ](name='Solutions'),
  startDate?: string(name='StartDate', example='2022-04-27T07:04:39Z'),
  status?: int32(name='Status', example='3'),
  title?: string(name='Title'),
}

model DescribeFaqResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFaqResponseBody(name='body'),
}

/**
 * @summary 知识详情
 *
 * @param request DescribeFaqRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeFaqResponse
 */
async function describeFaqWithOptions(request: DescribeFaqRequest, runtime: Util.RuntimeOptions): DescribeFaqResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeFaq',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 知识详情
 *
 * @param request DescribeFaqRequest
 * @return DescribeFaqResponse
 */
async function describeFaq(request: DescribeFaqRequest): DescribeFaqResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFaqWithOptions(request, runtime);
}

model DescribeInstanceRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model DescribeInstanceResponseBody = {
  avatar?: string(name='Avatar', example='/alimefe/meebot/robot/0.0.5/img/xxx-90-97.png'),
  categories?: [ 
    {
      categoryId?: long(name='CategoryId', example='30000066832'),
      name?: string(name='Name', example='杭州市防疫政策'),
      parentCategoryId?: long(name='ParentCategoryId', example='-1'),
    }
  ](name='Categories'),
  createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
  editStatus?: string(name='EditStatus', example='PUBLISHED'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  introduction?: string(name='Introduction', example='用于C端问答的机器人'),
  languageCode?: string(name='LanguageCode', example='zh-cn'),
  name?: string(name='Name', example='智能客服-小C'),
  requestId?: string(name='RequestId', example='907AA5F2-0521-49AB-80AB-1ADEFAB2B901'),
  robotType?: string(name='RobotType', example='scenario_im'),
  timeZone?: string(name='TimeZone', example='Asia/Chongqing'),
}

model DescribeInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceResponseBody(name='body'),
}

/**
 * @summary 机器人-详情
 *
 * @param request DescribeInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceResponse
 */
async function describeInstanceWithOptions(request: DescribeInstanceRequest, runtime: Util.RuntimeOptions): DescribeInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstance',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 机器人-详情
 *
 * @param request DescribeInstanceRequest
 * @return DescribeInstanceResponse
 */
async function describeInstance(request: DescribeInstanceRequest): DescribeInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceWithOptions(request, runtime);
}

model DescribeIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='123'),
}

model DescribeIntentResponseBody = {
  aliasName?: string(name='AliasName'),
  createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
  createUserId?: string(name='CreateUserId', example='123231'),
  createUserName?: string(name='CreateUserName', example='test'),
  intentId?: long(name='IntentId', example='84243341'),
  intentName?: string(name='IntentName'),
  modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
  modifyUserId?: string(name='ModifyUserId', example='123231'),
  modifyUserName?: string(name='ModifyUserName', example='test'),
  requestId?: string(name='RequestId', example='a22afaf2adfasf2gr345fga45ada'),
  slotInfos?: [ 
    {
      array?: boolean(name='Array', example='false'),
      encrypt?: boolean(name='Encrypt', example='false'),
      interactive?: boolean(name='Interactive', example='false'),
      name?: string(name='Name'),
      slotId?: string(name='SlotId', example='aa4d2a343a3ad4afad'),
      value?: string(name='Value'),
    }
  ](name='SlotInfos'),
}

model DescribeIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeIntentResponseBody(name='body'),
}

/**
 * @summary 意图-详情
 *
 * @param request DescribeIntentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeIntentResponse
 */
async function describeIntentWithOptions(request: DescribeIntentRequest, runtime: Util.RuntimeOptions): DescribeIntentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.intentId)) {
    body['IntentId'] = request.intentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeIntent',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-详情
 *
 * @param request DescribeIntentRequest
 * @return DescribeIntentResponse
 */
async function describeIntent(request: DescribeIntentRequest): DescribeIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIntentWithOptions(request, runtime);
}

model DescribePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  perspectiveId?: string(name='PerspectiveId', example='3001'),
}

model DescribePerspectiveResponseBody = {
  createTime?: string(name='CreateTime', example='2021-07-27T07:05:37Z'),
  modifyTime?: string(name='ModifyTime', example='2021-07-26T07:05:37Z'),
  name?: string(name='Name', example='移动端视角'),
  perspectiveCode?: string(name='PerspectiveCode', example='FZJBY3raWr'),
  perspectiveId?: string(name='PerspectiveId', example='3001'),
  requestId?: string(name='RequestId', example='F285D735-D580-18A8-B97F-B2E72B00F101'),
  selfDefine?: boolean(name='SelfDefine', example='true'),
  status?: int32(name='Status', example='1'),
}

model DescribePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePerspectiveResponseBody(name='body'),
}

/**
 * @summary 视角-详情
 *
 * @param request DescribePerspectiveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePerspectiveResponse
 */
async function describePerspectiveWithOptions(request: DescribePerspectiveRequest, runtime: Util.RuntimeOptions): DescribePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePerspective',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视角-详情
 *
 * @param request DescribePerspectiveRequest
 * @return DescribePerspectiveResponse
 */
async function describePerspective(request: DescribePerspectiveRequest): DescribePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePerspectiveWithOptions(request, runtime);
}

model FeedbackRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  feedback?: string(name='Feedback', example='good'),
  feedbackContent?: string(name='FeedbackContent', example='这个回答很棒'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  messageId?: string(name='MessageId', example='5ca40988-4f99-47ad-ac96-9060d0f81db9'),
  sessionId?: string(name='SessionId', example='7c3cec23cc8940bc9db4a318c8f4f0aa'),
}

model FeedbackResponseBody = {
  feedback?: string(name='Feedback', example='good'),
  messageId?: string(name='MessageId', example='5ca40988-4f99-47ad-ac96-9060d0f81db9'),
  requestId?: string(name='RequestId', example='4e5eea71-f326-450c-8849-49515473ef64'),
}

model FeedbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FeedbackResponseBody(name='body'),
}

/**
 * @summary 问答点赞、点踩API
 *
 * @param request FeedbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return FeedbackResponse
 */
async function feedbackWithOptions(request: FeedbackRequest, runtime: Util.RuntimeOptions): FeedbackResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.feedback)) {
    query['Feedback'] = request.feedback;
  }
  if (!Util.isUnset(request.feedbackContent)) {
    query['FeedbackContent'] = request.feedbackContent;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.messageId)) {
    query['MessageId'] = request.messageId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Feedback',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 问答点赞、点踩API
 *
 * @param request FeedbackRequest
 * @return FeedbackResponse
 */
async function feedback(request: FeedbackRequest): FeedbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return feedbackWithOptions(request, runtime);
}

model GenerateUserAccessTokenRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  email?: string(name='Email', example='a***bcx@gmail.com'),
  expireTime?: int32(name='ExpireTime', example='1000'),
  extraInfo?: string(name='ExtraInfo'),
  foreignId?: string(name='ForeignId', description='This parameter is required.', example='8882022040000000171'),
  nick?: string(name='Nick', description='This parameter is required.'),
  telephone?: string(name='Telephone', example='1381111****'),
}

model GenerateUserAccessTokenResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='DDEXEDAFWAGASDFWAEFFAWEFAWFWEAFWAFWAEF'),
  message?: string(name='Message', example='Parameter.Invalid'),
  requestId?: string(name='RequestId', description='Id of the request', example='E6988CE6-41CF-1103-9BEC-2B20D26C0B51'),
  success?: boolean(name='Success', example='true'),
}

model GenerateUserAccessTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateUserAccessTokenResponseBody(name='body'),
}

/**
 * @summary 生成用户免登Token
 *
 * @param request GenerateUserAccessTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateUserAccessTokenResponse
 */
async function generateUserAccessTokenWithOptions(request: GenerateUserAccessTokenRequest, runtime: Util.RuntimeOptions): GenerateUserAccessTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.extraInfo)) {
    query['ExtraInfo'] = request.extraInfo;
  }
  if (!Util.isUnset(request.foreignId)) {
    query['ForeignId'] = request.foreignId;
  }
  if (!Util.isUnset(request.nick)) {
    query['Nick'] = request.nick;
  }
  if (!Util.isUnset(request.telephone)) {
    query['Telephone'] = request.telephone;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GenerateUserAccessToken',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 生成用户免登Token
 *
 * @param request GenerateUserAccessTokenRequest
 * @return GenerateUserAccessTokenResponse
 */
async function generateUserAccessToken(request: GenerateUserAccessTokenRequest): GenerateUserAccessTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateUserAccessTokenWithOptions(request, runtime);
}

model GetAgentInfoRequest {
  instanceId?: string(name='InstanceId', example='beebot_bot_public_cn-ca36x8v3n1x'),
}

model GetAgentInfoResponseBody = {
  data?: {
    agentKey?: string(name='AgentKey', example='4e7400028e6f4a7393ed3acf6a7b8927_p_beebot_public'),
    agentName?: string(name='AgentName'),
  }(name='Data'),
  message?: string(name='Message', example='Parameter.Invalid'),
  requestId?: string(name='RequestId', description='Id of the request', example='FC384CE1-8D42-1900-84E1-F33F990F2B5E'),
  success?: boolean(name='Success', example='true'),
}

model GetAgentInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAgentInfoResponseBody(name='body'),
}

/**
 * @summary 获取业务空间信息
 *
 * @param request GetAgentInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAgentInfoResponse
 */
async function getAgentInfoWithOptions(request: GetAgentInfoRequest, runtime: Util.RuntimeOptions): GetAgentInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgentInfo',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取业务空间信息
 *
 * @param request GetAgentInfoRequest
 * @return GetAgentInfoResponse
 */
async function getAgentInfo(request: GetAgentInfoRequest): GetAgentInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentInfoWithOptions(request, runtime);
}

model GetAsyncResultRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  taskId?: string(name='TaskId', description='This parameter is required.'),
}

model GetAsyncResultResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId', example='F79E7305-5314-5069-A701-9591AD051902'),
  status?: string(name='Status', example='Success'),
}

model GetAsyncResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAsyncResultResponseBody(name='body'),
}

/**
 * @summary 获取异步函数执行结果接口
 *
 * @param request GetAsyncResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAsyncResultResponse
 */
async function getAsyncResultWithOptions(request: GetAsyncResultRequest, runtime: Util.RuntimeOptions): GetAsyncResultResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAsyncResult',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取异步函数执行结果接口
 *
 * @param request GetAsyncResultRequest
 * @return GetAsyncResultResponse
 */
async function getAsyncResult(request: GetAsyncResultRequest): GetAsyncResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAsyncResultWithOptions(request, runtime);
}

model GetBotSessionDataRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='20240605'),
  robotInstanceId?: string(name='RobotInstanceId', description='This parameter is required.', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='20240505'),
}

model GetBotSessionDataResponseBody = {
  costTime?: string(name='CostTime', example='116'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='15CD94CC-CBEB-4189-806C-A132D1F45D51'),
}

model GetBotSessionDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetBotSessionDataResponseBody(name='body'),
}

/**
 * @summary 查询机器人接待人次和对话轮次
 *
 * @param request GetBotSessionDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetBotSessionDataResponse
 */
async function getBotSessionDataWithOptions(request: GetBotSessionDataRequest, runtime: Util.RuntimeOptions): GetBotSessionDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetBotSessionData',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询机器人接待人次和对话轮次
 *
 * @param request GetBotSessionDataRequest
 * @return GetBotSessionDataResponse
 */
async function getBotSessionData(request: GetBotSessionDataRequest): GetBotSessionDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getBotSessionDataWithOptions(request, runtime);
}

model GetInstancePublishTaskStateRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  id?: long(name='Id', example='8521'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model GetInstancePublishTaskStateResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  errors?: map[string]any(name='Errors'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_RUNNING'),
  warnings?: map[string]any(name='Warnings'),
}

model GetInstancePublishTaskStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstancePublishTaskStateResponseBody(name='body'),
}

/**
 * @summary 查询机器人发布进度
 *
 * @param request GetInstancePublishTaskStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstancePublishTaskStateResponse
 */
async function getInstancePublishTaskStateWithOptions(request: GetInstancePublishTaskStateRequest, runtime: Util.RuntimeOptions): GetInstancePublishTaskStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInstancePublishTaskState',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询机器人发布进度
 *
 * @param request GetInstancePublishTaskStateRequest
 * @return GetInstancePublishTaskStateResponse
 */
async function getInstancePublishTaskState(request: GetInstancePublishTaskStateRequest): GetInstancePublishTaskStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstancePublishTaskStateWithOptions(request, runtime);
}

model GetPublishTaskStateRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  id?: long(name='Id', example='8521'),
}

model GetPublishTaskStateResponseBody = {
  bizTypeList?: [ string ](name='BizTypeList'),
  createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
  error?: string(name='Error'),
  errors?: map[string]any(name='Errors'),
  id?: long(name='Id', example='8522'),
  modifyTime?: string(name='ModifyTime', example='2022-04-12T06:30:33Z'),
  requestId?: string(name='RequestId', example='5CBF0581-EAE7-1DC4-95C6-A089656A1E2D'),
  response?: string(name='Response', example='8522'),
  status?: string(name='Status', example='FE_RUNNING'),
  warnings?: map[string]any(name='Warnings'),
}

model GetPublishTaskStateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPublishTaskStateResponseBody(name='body'),
}

/**
 * @summary 查询发布进度
 *
 * @param request GetPublishTaskStateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPublishTaskStateResponse
 */
async function getPublishTaskStateWithOptions(request: GetPublishTaskStateRequest, runtime: Util.RuntimeOptions): GetPublishTaskStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPublishTaskState',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询发布进度
 *
 * @param request GetPublishTaskStateRequest
 * @return GetPublishTaskStateResponse
 */
async function getPublishTaskState(request: GetPublishTaskStateRequest): GetPublishTaskStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPublishTaskStateWithOptions(request, runtime);
}

model InitIMConnectRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  from?: string(name='From', description='This parameter is required.', example='8XNBzDucJv'),
  userAccessToken?: string(name='UserAccessToken', example='QUM4SndaY3VPMjhkQldDZUNOR0ZaTmZ5R3NBY0FKWHJ4OGc4dERZbEJzcjNIKzFiS1RyTjhXRUpBYmVpQlpsakprNDRFVkdxcy9HWVk2RXZvalU3bHhxRkJlc1NBUXZwdHFKOTE2UTNwamQ4b1U4N3dEbmhyRjc4R2hOQStvMnMrYkV2dlVpSHNvWC96SEVNZWRqMjBuMXdjNklpamJzaDNWYllnUldDZGhJPQ=='),
}

model InitIMConnectResponseBody = {
  code?: string(name='Code', example='200'),
  data?: string(name='Data', example='{     "imDomain": "im.alimebot.com",     "appKey": "WDg2VfNv",     "token": "QUM4SndaY3VPMjhkQldDZUNOR0ZaTmZ5R3NBY0FKWHJ4OGc4dERZbEJzcjNIKzFiS1RyTjhXRUpBYmVpQlpsakprNDRFVkdxcy9HWVk2RXZvalU3bHhxRkJlc1NBUXZwdHFKOTE2UTNwamQ4b1U4N3dEbmhyRjc4R2hOQStvMnMrYkV2dlVpSHNvWC96SEVNZWRqMjBuMXdjNklpamJzaDNWYllnUldDZGhJPQ=="   }'),
  message?: string(name='Message', example='Parameter.Invalid'),
  requestId?: string(name='RequestId', description='Id of the request', example='E6988CE6-41CF-1103-9BEC-2B20D26C0B52'),
  success?: boolean(name='Success', example='true'),
}

model InitIMConnectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitIMConnectResponseBody(name='body'),
}

/**
 * @summary 初始化im连接信息
 *
 * @param request InitIMConnectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InitIMConnectResponse
 */
async function initIMConnectWithOptions(request: InitIMConnectRequest, runtime: Util.RuntimeOptions): InitIMConnectResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.from)) {
    query['From'] = request.from;
  }
  if (!Util.isUnset(request.userAccessToken)) {
    query['UserAccessToken'] = request.userAccessToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InitIMConnect',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 初始化im连接信息
 *
 * @param request InitIMConnectRequest
 * @return InitIMConnectResponse
 */
async function initIMConnect(request: InitIMConnectRequest): InitIMConnectResponse {
  var runtime = new Util.RuntimeOptions{};
  return initIMConnectWithOptions(request, runtime);
}

model LinkInstanceCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryIds?: string(name='CategoryIds', example='[\\\\"30000065789\\\\"]'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
}

model LinkInstanceCategoryResponseBody = {
  requestId?: string(name='RequestId', example='D8C96601-E645-1BD7-99F3-04EADAB84E29'),
}

model LinkInstanceCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LinkInstanceCategoryResponseBody(name='body'),
}

/**
 * @summary 机器人-绑定类目
 *
 * @param request LinkInstanceCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LinkInstanceCategoryResponse
 */
async function linkInstanceCategoryWithOptions(request: LinkInstanceCategoryRequest, runtime: Util.RuntimeOptions): LinkInstanceCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryIds)) {
    body['CategoryIds'] = request.categoryIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'LinkInstanceCategory',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 机器人-绑定类目
 *
 * @param request LinkInstanceCategoryRequest
 * @return LinkInstanceCategoryResponse
 */
async function linkInstanceCategory(request: LinkInstanceCategoryRequest): LinkInstanceCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return linkInstanceCategoryWithOptions(request, runtime);
}

model ListAgentRequest {
  agentName?: string(name='AgentName'),
  goodsCodes?: string(name='GoodsCodes'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListAgentResponseBody = {
  data?: [ 
    {
      agentId?: long(name='AgentId', example='881'),
      agentKey?: string(name='AgentKey', example='4e7400028e6f4a7393ed3acf6a7b8927_p_beebot_public'),
      agentName?: string(name='AgentName'),
      instanceInfos?: map[string]any(name='InstanceInfos'),
    }
  ](name='Data'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', description='Id of the request', example='F55D90C1-31BE-4B2A-AA3F-25EFC36F9419'),
  totalCount?: int32(name='TotalCount', example='6'),
}

model ListAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAgentResponseBody(name='body'),
}

/**
 * @summary 获取业务空间列表
 *
 * @param request ListAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAgentResponse
 */
async function listAgentWithOptions(request: ListAgentRequest, runtime: Util.RuntimeOptions): ListAgentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentName)) {
    query['AgentName'] = request.agentName;
  }
  if (!Util.isUnset(request.goodsCodes)) {
    query['GoodsCodes'] = request.goodsCodes;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAgent',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取业务空间列表
 *
 * @param request ListAgentRequest
 * @return ListAgentResponse
 */
async function listAgent(request: ListAgentRequest): ListAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAgentWithOptions(request, runtime);
}

model ListCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeType?: int32(name='KnowledgeType'),
  parentCategoryId?: long(name='ParentCategoryId', example='-1'),
}

model ListCategoryResponseBody = {
  categories?: [ 
    {
      bizCode?: string(name='BizCode'),
      categoryId?: long(name='CategoryId', example='231001028593'),
      name?: string(name='Name'),
      parentCategoryId?: long(name='ParentCategoryId', example='-1'),
      status?: int32(name='Status', example='0'),
    }
  ](name='Categories'),
  requestId?: string(name='RequestId', example='9C5F8186-2D22-433E-9545-606D344F30B5'),
}

model ListCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCategoryResponseBody(name='body'),
}

/**
 * @summary 类目列表
 *
 * @param request ListCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCategoryResponse
 */
async function listCategoryWithOptions(request: ListCategoryRequest, runtime: Util.RuntimeOptions): ListCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeType)) {
    body['KnowledgeType'] = request.knowledgeType;
  }
  if (!Util.isUnset(request.parentCategoryId)) {
    body['ParentCategoryId'] = request.parentCategoryId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListCategory',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 类目列表
 *
 * @param request ListCategoryRequest
 * @return ListCategoryResponse
 */
async function listCategory(request: ListCategoryRequest): ListCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCategoryWithOptions(request, runtime);
}

model ListConnQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
}

model ListConnQuestionResponseBody = {
  outlines?: [ 
    {
      connQuestionId?: long(name='ConnQuestionId', example='30001979424'),
      createTime?: string(name='CreateTime', example='2022-02-25T02:47:18Z'),
      modifyTime?: string(name='ModifyTime', example='2022-05-26T10:18:15Z'),
      outlineId?: long(name='OutlineId', example='797'),
      title?: string(name='Title'),
    }
  ](name='Outlines'),
  requestId?: string(name='RequestId', example='92B81548-42B9-4B34-924B-4E778AEB412B'),
}

model ListConnQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConnQuestionResponseBody(name='body'),
}

/**
 * @summary 查询FAQ关联问列表
 *
 * @param request ListConnQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConnQuestionResponse
 */
async function listConnQuestionWithOptions(request: ListConnQuestionRequest, runtime: Util.RuntimeOptions): ListConnQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListConnQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询FAQ关联问列表
 *
 * @param request ListConnQuestionRequest
 * @return ListConnQuestionResponse
 */
async function listConnQuestion(request: ListConnQuestionRequest): ListConnQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return listConnQuestionWithOptions(request, runtime);
}

model ListDSEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityType?: string(name='EntityType', example='system'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  keyword?: string(name='Keyword', example='实体'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListDSEntityResponseBody = {
  entities?: [ 
    {
      createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
      createUserId?: string(name='CreateUserId', example='123231'),
      createUserName?: string(name='CreateUserName', example='test'),
      entityId?: long(name='EntityId', example='234564567445'),
      entityName?: string(name='EntityName'),
      entityType?: string(name='EntityType', example='synonyms'),
      modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
      modifyUserId?: string(name='ModifyUserId', example='123231'),
      modifyUserName?: string(name='ModifyUserName', example='test'),
      sysEntityCode?: string(name='SysEntityCode'),
    }
  ](name='Entities'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='ga4h345defgwet2sdf223'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListDSEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDSEntityResponseBody(name='body'),
}

/**
 * @summary 实体-列表
 *
 * @param request ListDSEntityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDSEntityResponse
 */
async function listDSEntityWithOptions(request: ListDSEntityRequest, runtime: Util.RuntimeOptions): ListDSEntityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDSEntity',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体-列表
 *
 * @param request ListDSEntityRequest
 * @return ListDSEntityResponse
 */
async function listDSEntity(request: ListDSEntityRequest): ListDSEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDSEntityWithOptions(request, runtime);
}

model ListDSEntityValueRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='123'),
  entityValueId?: long(name='EntityValueId', example='234'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  keyword?: string(name='Keyword'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListDSEntityValueResponseBody = {
  entityValues?: [ 
    {
      content?: string(name='Content'),
      createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
      entityId?: long(name='EntityId', example='34313785463'),
      entityValueId?: long(name='EntityValueId', example='3467858234534534532'),
      modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
      synonyms?: [ string ](name='Synonyms'),
    }
  ](name='EntityValues'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='n3fg34gbfj8adf2gj923'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListDSEntityValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDSEntityValueResponseBody(name='body'),
}

/**
 * @summary 实体成员-列表
 *
 * @param request ListDSEntityValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDSEntityValueResponse
 */
async function listDSEntityValueWithOptions(request: ListDSEntityValueRequest, runtime: Util.RuntimeOptions): ListDSEntityValueResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.entityId)) {
    body['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.entityValueId)) {
    body['EntityValueId'] = request.entityValueId;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDSEntityValue',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体成员-列表
 *
 * @param request ListDSEntityValueRequest
 * @return ListDSEntityValueResponse
 */
async function listDSEntityValue(request: ListDSEntityValueRequest): ListDSEntityValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDSEntityValueWithOptions(request, runtime);
}

model ListInstanceRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  name?: string(name='Name', example='scenario_im'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='10'),
  robotType?: string(name='RobotType', example='scenario_im'),
}

model ListInstanceResponseBody = {
  instances?: [ 
    {
      avatar?: string(name='Avatar', example='/alimefe/meebot/robot/0.0.5/img/xxx-90-97.png'),
      createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
      instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
      introduction?: string(name='Introduction', example='用于C端问答的机器人'),
      languageCode?: string(name='LanguageCode', example='zh-cn'),
      name?: string(name='Name', example='智能客服-小C'),
      robotType?: string(name='RobotType', example='scenario_im'),
    }
  ](name='Instances'),
  pageNumber?: long(name='PageNumber', example='1'),
  pageSize?: long(name='PageSize', example='5'),
  requestId?: string(name='RequestId', example='92B81548-42B9-4B34-924B-4E778AEB412B'),
  totalCount?: long(name='TotalCount', example='23'),
}

model ListInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstanceResponseBody(name='body'),
}

/**
 * @summary 机器人-修改
 *
 * @param request ListInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstanceResponse
 */
async function listInstanceWithOptions(request: ListInstanceRequest, runtime: Util.RuntimeOptions): ListInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.robotType)) {
    query['RobotType'] = request.robotType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstance',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 机器人-修改
 *
 * @param request ListInstanceRequest
 * @return ListInstanceResponse
 */
async function listInstance(request: ListInstanceRequest): ListInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listInstanceWithOptions(request, runtime);
}

model ListIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentName?: string(name='IntentName', example='查天气'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListIntentResponseBody = {
  intents?: [ 
    {
      aliasName?: string(name='AliasName'),
      createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
      createUserId?: string(name='CreateUserId', example='123231'),
      createUserName?: string(name='CreateUserName', example='test'),
      intentId?: long(name='IntentId', example='234234234234'),
      intentName?: string(name='IntentName'),
      modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
      modifyUserId?: string(name='ModifyUserId', example='123231'),
      modifyUserName?: string(name='ModifyUserName', example='test'),
      slotInfos?: [ 
        {
          array?: boolean(name='Array', example='false'),
          encrypt?: boolean(name='Encrypt', example='false'),
          interactive?: boolean(name='Interactive', example='false'),
          name?: string(name='Name'),
          slotId?: string(name='SlotId', example='12134223'),
          value?: string(name='Value'),
        }
      ](name='SlotInfos'),
    }
  ](name='Intents'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='23dsfa34r2s2s2sd12'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntentResponseBody(name='body'),
}

/**
 * @summary 意图-列表
 *
 * @param request ListIntentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntentResponse
 */
async function listIntentWithOptions(request: ListIntentRequest, runtime: Util.RuntimeOptions): ListIntentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentName)) {
    query['IntentName'] = request.intentName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListIntent',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-列表
 *
 * @param request ListIntentRequest
 * @return ListIntentResponse
 */
async function listIntent(request: ListIntentRequest): ListIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return listIntentWithOptions(request, runtime);
}

model ListLgfRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='123'),
  lgfText?: string(name='LgfText', example='.{0,5}北京天气'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListLgfResponseBody = {
  lgfs?: [ 
    {
      createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
      intentId?: long(name='IntentId', example='256756734345'),
      lgfId?: long(name='LgfId', description='LGF ID', example='123'),
      modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
      ruleText?: string(name='RuleText'),
    }
  ](name='Lgfs'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='34fg57h2gh5783'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListLgfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLgfResponseBody(name='body'),
}

/**
 * @summary 意图-LGF-列表
 *
 * @param request ListLgfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLgfResponse
 */
async function listLgfWithOptions(request: ListLgfRequest, runtime: Util.RuntimeOptions): ListLgfResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  if (!Util.isUnset(request.lgfText)) {
    query['LgfText'] = request.lgfText;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLgf',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-LGF-列表
 *
 * @param request ListLgfRequest
 * @return ListLgfResponse
 */
async function listLgf(request: ListLgfRequest): ListLgfResponse {
  var runtime = new Util.RuntimeOptions{};
  return listLgfWithOptions(request, runtime);
}

model ListSaasInfoRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  saasGroupCodes?: string(name='SaasGroupCodes', example='DS,FAQ'),
  saasName?: string(name='SaasName', description='This parameter is required.', example='userTest'),
}

model ListSaasInfoResponseBody = {
  data?: [ 
    {
      code?: string(name='Code', example='GLOBAL_SERVICE'),
      enName?: string(name='EnName', example='GLOBAL SERVICE'),
      name?: string(name='Name'),
      serviceUrl?: string(name='ServiceUrl', example='https://pre-alime4service.console.aliyun.com/?productCode=p_beebot_public&switchAgent=1204001&saasCode=Robot&saasToken=06614fdb-c72f-436e-8003-dfe8a2854a15&saasName=123#/robot'),
      url?: string(name='Url', example='https://alime.console.aliyun.com/?productCode=p_beebot_public&switchAgent=1204001&saasCode=Robot&saasToken=06614fdb-c72f-436e-8003-dfe8a2854a15&saasName=123#/robot'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', description='Id of the request', example='A629A28F-F25E-5572-A679-FA46FB0151D6'),
  saasToken?: string(name='SaasToken', example='06614fdb-c72f-436e-8003-dfe8a2854a15'),
}

model ListSaasInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSaasInfoResponseBody(name='body'),
}

/**
 * @summary 获取业务空间下可集成的SaaS信息列表
 *
 * @param request ListSaasInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSaasInfoResponse
 */
async function listSaasInfoWithOptions(request: ListSaasInfoRequest, runtime: Util.RuntimeOptions): ListSaasInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.saasGroupCodes)) {
    query['SaasGroupCodes'] = request.saasGroupCodes;
  }
  if (!Util.isUnset(request.saasName)) {
    query['SaasName'] = request.saasName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSaasInfo',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取业务空间下可集成的SaaS信息列表
 *
 * @param request ListSaasInfoRequest
 * @return ListSaasInfoResponse
 */
async function listSaasInfo(request: ListSaasInfoRequest): ListSaasInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSaasInfoWithOptions(request, runtime);
}

model ListSaasPermissionGroupInfosRequest {
  agentKey?: string(name='AgentKey', description='This parameter is required.', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
}

model ListSaasPermissionGroupInfosResponseBody = {
  data?: [ 
    {
      enName?: string(name='EnName', example='Release Center'),
      name?: string(name='Name'),
      pgInfos?: [ 
        {
          pgCode?: string(name='PgCode', example='FAQ'),
          pgEnName?: string(name='PgEnName', example='FAQ'),
          pgName?: string(name='PgName'),
        }
      ](name='PgInfos'),
      saasCode?: string(name='SaasCode', example='FAQ'),
    }
  ](name='Data'),
  requestId?: string(name='RequestId', description='Id of the request', example='8AD9FA10-7780-5E12-B701-13C928524F32'),
}

model ListSaasPermissionGroupInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSaasPermissionGroupInfosResponseBody(name='body'),
}

/**
 * @summary 获取业务空间下可集成的权限组信息
 *
 * @param request ListSaasPermissionGroupInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSaasPermissionGroupInfosResponse
 */
async function listSaasPermissionGroupInfosWithOptions(request: ListSaasPermissionGroupInfosRequest, runtime: Util.RuntimeOptions): ListSaasPermissionGroupInfosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSaasPermissionGroupInfos',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取业务空间下可集成的权限组信息
 *
 * @param request ListSaasPermissionGroupInfosRequest
 * @return ListSaasPermissionGroupInfosResponse
 */
async function listSaasPermissionGroupInfos(request: ListSaasPermissionGroupInfosRequest): ListSaasPermissionGroupInfosResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSaasPermissionGroupInfosWithOptions(request, runtime);
}

model ListSimQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30002299537'),
}

model ListSimQuestionResponseBody = {
  requestId?: string(name='RequestId', example='15CD94CC-CBEB-4189-806C-A132D1F45D51'),
  simQuestions?: [ 
    {
      createTime?: string(name='CreateTime', example='2022-05-30T02:08:33Z'),
      modifyTime?: string(name='ModifyTime', example='2022-05-13T03:49:28Z'),
      simQuestionId?: long(name='SimQuestionId', example='30001979424'),
      title?: string(name='Title'),
    }
  ](name='SimQuestions'),
}

model ListSimQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSimQuestionResponseBody(name='body'),
}

/**
 * @summary FAQ相似问列表
 *
 * @param request ListSimQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSimQuestionResponse
 */
async function listSimQuestionWithOptions(request: ListSimQuestionRequest, runtime: Util.RuntimeOptions): ListSimQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSimQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary FAQ相似问列表
 *
 * @param request ListSimQuestionRequest
 * @return ListSimQuestionResponse
 */
async function listSimQuestion(request: ListSimQuestionRequest): ListSimQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSimQuestionWithOptions(request, runtime);
}

model ListSolutionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
}

model ListSolutionResponseBody = {
  requestId?: string(name='RequestId', example='5B29DB5E-251D-5A73-84B5-A12DF795F231'),
  solutions?: [ 
    {
      content?: string(name='Content'),
      contentType?: int32(name='ContentType', example='1'),
      createTime?: string(name='CreateTime', example='2022-03-29T03:55:04Z'),
      modifyTime?: string(name='ModifyTime', example='2022-03-29T06:23:53Z'),
      perspectiveCodes?: [ string ](name='PerspectiveCodes'),
      plainText?: string(name='PlainText'),
      solutionId?: long(name='SolutionId', example='496'),
    }
  ](name='Solutions'),
}

model ListSolutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSolutionResponseBody(name='body'),
}

/**
 * @summary FAQ答案列表
 *
 * @param request ListSolutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSolutionResponse
 */
async function listSolutionWithOptions(request: ListSolutionRequest, runtime: Util.RuntimeOptions): ListSolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSolution',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary FAQ答案列表
 *
 * @param request ListSolutionRequest
 * @return ListSolutionResponse
 */
async function listSolution(request: ListSolutionRequest): ListSolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSolutionWithOptions(request, runtime);
}

model ListTongyiChatHistorysRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2024-04-01 08:00:00'),
  limit?: int32(name='Limit', example='30'),
  robotInstanceId?: string(name='RobotInstanceId', description='This parameter is required.', example='chatbot-cn-7QuUfaqMQe'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2024-04-01 00:00:00'),
}

model ListTongyiChatHistorysResponseBody = {
  costTime?: string(name='CostTime', example='116'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='D0DDFC4C-D66D-4787-9AE4-4D757481EDEE'),
}

model ListTongyiChatHistorysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTongyiChatHistorysResponseBody(name='body'),
}

/**
 * @summary Tongyi对话明细查询接口
 *
 * @param request ListTongyiChatHistorysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTongyiChatHistorysResponse
 */
async function listTongyiChatHistorysWithOptions(request: ListTongyiChatHistorysRequest, runtime: Util.RuntimeOptions): ListTongyiChatHistorysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.limit)) {
    query['Limit'] = request.limit;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTongyiChatHistorys',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Tongyi对话明细查询接口
 *
 * @param request ListTongyiChatHistorysRequest
 * @return ListTongyiChatHistorysResponse
 */
async function listTongyiChatHistorys(request: ListTongyiChatHistorysRequest): ListTongyiChatHistorysResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTongyiChatHistorysWithOptions(request, runtime);
}

model ListTongyiConversationLogsRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  robotInstanceId?: string(name='RobotInstanceId', description='This parameter is required.', example='chatbot-cn-7QuUfaqMQe'),
  sessionId?: string(name='SessionId', description='This parameter is required.', example='7c3cec23cc8940bc9db4a318c8f4f0aa'),
}

model ListTongyiConversationLogsResponseBody = {
  costTime?: string(name='CostTime', example='66'),
  datas?: [  map[string]any ](name='Datas'),
  requestId?: string(name='RequestId', example='28805A7C-D695-548C-A31B-67E52C2C274F'),
}

model ListTongyiConversationLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTongyiConversationLogsResponseBody(name='body'),
}

/**
 * @summary 查询通义晓蜜的单个会话对话记录
 *
 * @param request ListTongyiConversationLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTongyiConversationLogsResponse
 */
async function listTongyiConversationLogsWithOptions(request: ListTongyiConversationLogsRequest, runtime: Util.RuntimeOptions): ListTongyiConversationLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.robotInstanceId)) {
    query['RobotInstanceId'] = request.robotInstanceId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTongyiConversationLogs',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询通义晓蜜的单个会话对话记录
 *
 * @param request ListTongyiConversationLogsRequest
 * @return ListTongyiConversationLogsResponse
 */
async function listTongyiConversationLogs(request: ListTongyiConversationLogsRequest): ListTongyiConversationLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTongyiConversationLogsWithOptions(request, runtime);
}

model ListUserSayRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', example='您做核酸了嘛'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='232'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListUserSayResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='fs1fg4512v43572v23'),
  totalCount?: int32(name='TotalCount', example='1'),
  userSays?: [ 
    {
      content?: string(name='Content'),
      createTime?: string(name='CreateTime', example='2021-08-12T16:00:01Z'),
      intentId?: long(name='IntentId', example='235564564'),
      modifyTime?: string(name='ModifyTime', example='2021-08-12T16:00:01Z'),
      slotInfos?: [ 
        {
          endIndex?: int32(name='EndIndex', example='4'),
          slotId?: string(name='SlotId', example='3456sdfg3tu'),
          startIndex?: int32(name='StartIndex', example='2'),
        }
      ](name='SlotInfos'),
      userSayId?: long(name='UserSayId', example='3453452138'),
    }
  ](name='UserSays'),
}

model ListUserSayResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserSayResponseBody(name='body'),
}

/**
 * @summary 话术-列表
 *
 * @param request ListUserSayRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserSayResponse
 */
async function listUserSayWithOptions(request: ListUserSayRequest, runtime: Util.RuntimeOptions): ListUserSayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserSay',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 话术-列表
 *
 * @param request ListUserSayRequest
 * @return ListUserSayResponse
 */
async function listUserSay(request: ListUserSayRequest): ListUserSayResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserSayWithOptions(request, runtime);
}

model NluRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  utterance?: string(name='Utterance', example='北京的天气怎么样'),
}

model NluResponseBody = {
  messageId?: string(name='MessageId', example='2828708A-2C7A-1BAE-B810-87DB9DA9C661'),
  messages?: [ 
    {
      dialogHubNluInfo?: {
        globalDictList?: [ 
          {
            standardWord?: string(name='StandardWord', example='天气'),
            word?: string(name='Word', example='天气'),
          }
        ](name='GlobalDictList'),
        globalSensitiveWordList?: [ 
          {
            standardWord?: string(name='StandardWord', example='天气'),
            word?: string(name='Word', example='天气'),
          }
        ](name='GlobalSensitiveWordList'),
      }(name='DialogHubNluInfo'),
      dsNluInfo?: {
        entityList?: [ 
          {
            name?: string(name='Name', example='@城市'),
            origin?: string(name='Origin', example='北京'),
            type?: string(name='Type', example='text'),
            value?: string(name='Value', example='首都'),
          }
        ](name='EntityList'),
        intentList?: [ 
          {
            intentId?: long(name='IntentId', example='724387'),
            matchDetail?: string(name='MatchDetail', example='classifierType=Fewshot,from=Fewshot,content=[我要查北京的天气, 帮我查北京的天气, 北京天气怎么样, 北京今天下雨吗, 北京今天多少度]'),
            matchType?: string(name='MatchType', example='FewShotLearning'),
            name?: string(name='Name', example='查天气意图'),
            score?: double(name='Score', example='0.995'),
            slotList?: [ 
              {
                name?: string(name='Name', example='@城市'),
                origin?: string(name='Origin', example='北京'),
                type?: string(name='Type', example='text'),
                value?: string(name='Value', example='首都'),
              }
            ](name='SlotList'),
          }
        ](name='IntentList'),
      }(name='DsNluInfo'),
    }
  ](name='Messages'),
  requestId?: string(name='RequestId', example='A6357C1B-1D79-1382-B259-BD9E80751B42'),
}

model NluResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: NluResponseBody(name='body'),
}

/**
 * @summary 统一NLU接口
 *
 * @param request NluRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return NluResponse
 */
async function nluWithOptions(request: NluRequest, runtime: Util.RuntimeOptions): NluResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.utterance)) {
    query['Utterance'] = request.utterance;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Nlu',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 统一NLU接口
 *
 * @param request NluRequest
 * @return NluResponse
 */
async function nlu(request: NluRequest): NluResponse {
  var runtime = new Util.RuntimeOptions{};
  return nluWithOptions(request, runtime);
}

model QueryPerspectivesRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
}

model QueryPerspectivesResponseBody = {
  perspectives?: [ 
    {
      createTime?: string(name='CreateTime', example='2022-04-12T06:30:17Z'),
      modifyTime?: string(name='ModifyTime', example='2022-04-29T03:38:54Z'),
      name?: string(name='Name', example='移动端视角'),
      perspectiveCode?: string(name='PerspectiveCode', example='FZJBY3raWr'),
      perspectiveId?: string(name='PerspectiveId', example='3001'),
      selfDefine?: boolean(name='SelfDefine', example='true'),
      status?: int32(name='Status', example='1'),
    }
  ](name='Perspectives'),
  requestId?: string(name='RequestId', example='F285D735-D580-18A8-B97F-B2E72B00F101'),
}

model QueryPerspectivesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryPerspectivesResponseBody(name='body'),
}

/**
 * @summary 视角-列表
 *
 * @param request QueryPerspectivesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryPerspectivesResponse
 */
async function queryPerspectivesWithOptions(request: QueryPerspectivesRequest, runtime: Util.RuntimeOptions): QueryPerspectivesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryPerspectives',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视角-列表
 *
 * @param request QueryPerspectivesRequest
 * @return QueryPerspectivesResponse
 */
async function queryPerspectives(request: QueryPerspectivesRequest): QueryPerspectivesResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryPerspectivesWithOptions(request, runtime);
}

model RetryDocRequest {
  agentKey?: string(name='AgentKey', example='e2a20f74cd9042558002c0f7dc873739_p_outbound_public'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
}

model RetryDocResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30001905617'),
  requestId?: string(name='RequestId', description='Id of the request', example='6419BA93-D111-5225-8998-13E63E6D3940'),
}

model RetryDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetryDocResponseBody(name='body'),
}

/**
 * @summary 文档重试
 *
 * @param request RetryDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetryDocResponse
 */
async function retryDocWithOptions(request: RetryDocRequest, runtime: Util.RuntimeOptions): RetryDocResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RetryDoc',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档重试
 *
 * @param request RetryDocRequest
 * @return RetryDocResponse
 */
async function retryDoc(request: RetryDocRequest): RetryDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return retryDocWithOptions(request, runtime);
}

model SearchDocRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryIds?: [ long ](name='CategoryIds'),
  createTimeBegin?: string(name='CreateTimeBegin', example='2022-04-02T03:09:30Z'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2022-05-02T03:09:30Z'),
  createUserName?: string(name='CreateUserName'),
  endTimeBegin?: string(name='EndTimeBegin', example='2023-04-02T03:09:30Z'),
  endTimeEnd?: string(name='EndTimeEnd', example='2023-05-02T03:09:30Z'),
  keyword?: string(name='Keyword'),
  modifyTimeBegin?: string(name='ModifyTimeBegin', example='2023-04-02T03:09:30Z'),
  modifyTimeEnd?: string(name='ModifyTimeEnd', example='2023-05-02T03:09:30Z'),
  modifyUserName?: string(name='ModifyUserName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  processStatus?: int32(name='ProcessStatus', example='0'),
  searchScope?: int32(name='SearchScope', example='1'),
  startTimeBegin?: string(name='StartTimeBegin', example='2022-04-02T03:09:30Z'),
  startTimeEnd?: string(name='StartTimeEnd', example='2022-04-03T03:09:30Z'),
  status?: int32(name='Status', example='1'),
  tagIds?: [ long ](name='TagIds'),
}

model SearchDocShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryIdsShrink?: string(name='CategoryIds'),
  createTimeBegin?: string(name='CreateTimeBegin', example='2022-04-02T03:09:30Z'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2022-05-02T03:09:30Z'),
  createUserName?: string(name='CreateUserName'),
  endTimeBegin?: string(name='EndTimeBegin', example='2023-04-02T03:09:30Z'),
  endTimeEnd?: string(name='EndTimeEnd', example='2023-05-02T03:09:30Z'),
  keyword?: string(name='Keyword'),
  modifyTimeBegin?: string(name='ModifyTimeBegin', example='2023-04-02T03:09:30Z'),
  modifyTimeEnd?: string(name='ModifyTimeEnd', example='2023-05-02T03:09:30Z'),
  modifyUserName?: string(name='ModifyUserName'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  processStatus?: int32(name='ProcessStatus', example='0'),
  searchScope?: int32(name='SearchScope', example='1'),
  startTimeBegin?: string(name='StartTimeBegin', example='2022-04-02T03:09:30Z'),
  startTimeEnd?: string(name='StartTimeEnd', example='2022-04-03T03:09:30Z'),
  status?: int32(name='Status', example='1'),
  tagIdsShrink?: string(name='TagIds'),
}

model SearchDocResponseBody = {
  docHits?: [ 
    {
      bizCode?: string(name='BizCode', example='cn_dytns'),
      categoryId?: long(name='CategoryId', example='30000135654'),
      config?: string(name='Config', example='{"Splitter":"treeSplitter","ChunkSize":500,"TreePatterns":["^# .*","^## .*","^### .*","^#### .*"],"TitleSource":"docName"}'),
      createTime?: string(name='CreateTime', example='2023-06-22T03:53:41Z'),
      createUserId?: long(name='CreateUserId', example='111111111'),
      createUserName?: string(name='CreateUserName'),
      docName?: string(name='DocName'),
      docTags?: [ 
        {
          defaultTag?: boolean(name='DefaultTag'),
          groupId?: long(name='GroupId'),
          groupName?: string(name='GroupName'),
          tagId?: long(name='TagId'),
          tagName?: string(name='TagName'),
        }
      ](name='DocTags'),
      effectStatus?: int32(name='EffectStatus', example='20'),
      endDate?: string(name='EndDate', example='2099-12-31T16:00:00Z'),
      knowledgeId?: long(name='KnowledgeId', example='30002692007'),
      meta?: string(name='Meta', example='{"code":"xxx"}'),
      modifyTime?: string(name='ModifyTime', example='2023-06-25T02:27:42Z'),
      modifyUserId?: long(name='ModifyUserId', example='222222222'),
      modifyUserName?: string(name='ModifyUserName'),
      processCanRetry?: boolean(name='ProcessCanRetry', example='true'),
      processMessage?: string(name='ProcessMessage'),
      processStatus?: int32(name='ProcessStatus', example='0'),
      startDate?: string(name='StartDate', example='2023-02-28T11:40:18Z'),
      status?: int32(name='Status', example='1'),
      url?: string(name='Url'),
    }
  ](name='DocHits'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', description='Id of the request', example='E3E5C779-A630-45AC-B0F2-A4506A4212F1'),
  totalCount?: int32(name='TotalCount', example='141'),
}

model SearchDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchDocResponseBody(name='body'),
}

/**
 * @summary 文档搜索
 *
 * @param tmpReq SearchDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchDocResponse
 */
async function searchDocWithOptions(tmpReq: SearchDocRequest, runtime: Util.RuntimeOptions): SearchDocResponse {
  Util.validateModel(tmpReq);
  var request = new SearchDocShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.categoryIds)) {
    request.categoryIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.categoryIds, 'CategoryIds', 'json');
  }
  if (!Util.isUnset(tmpReq.tagIds)) {
    request.tagIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagIds, 'TagIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryIdsShrink)) {
    query['CategoryIds'] = request.categoryIdsShrink;
  }
  if (!Util.isUnset(request.createTimeBegin)) {
    query['CreateTimeBegin'] = request.createTimeBegin;
  }
  if (!Util.isUnset(request.createTimeEnd)) {
    query['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!Util.isUnset(request.createUserName)) {
    query['CreateUserName'] = request.createUserName;
  }
  if (!Util.isUnset(request.endTimeBegin)) {
    query['EndTimeBegin'] = request.endTimeBegin;
  }
  if (!Util.isUnset(request.endTimeEnd)) {
    query['EndTimeEnd'] = request.endTimeEnd;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.modifyTimeBegin)) {
    query['ModifyTimeBegin'] = request.modifyTimeBegin;
  }
  if (!Util.isUnset(request.modifyTimeEnd)) {
    query['ModifyTimeEnd'] = request.modifyTimeEnd;
  }
  if (!Util.isUnset(request.modifyUserName)) {
    query['ModifyUserName'] = request.modifyUserName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.processStatus)) {
    query['ProcessStatus'] = request.processStatus;
  }
  if (!Util.isUnset(request.searchScope)) {
    query['SearchScope'] = request.searchScope;
  }
  if (!Util.isUnset(request.startTimeBegin)) {
    query['StartTimeBegin'] = request.startTimeBegin;
  }
  if (!Util.isUnset(request.startTimeEnd)) {
    query['StartTimeEnd'] = request.startTimeEnd;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tagIdsShrink)) {
    query['TagIds'] = request.tagIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchDoc',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档搜索
 *
 * @param request SearchDocRequest
 * @return SearchDocResponse
 */
async function searchDoc(request: SearchDocRequest): SearchDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchDocWithOptions(request, runtime);
}

model SearchFaqRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryIds?: [ long ](name='CategoryIds'),
  createTimeBegin?: string(name='CreateTimeBegin', example='2022-04-02T03:09:30Z'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2022-05-02T03:09:30Z'),
  createUserName?: string(name='CreateUserName', example='test01'),
  endTimeBegin?: string(name='EndTimeBegin', example='2023-04-02T03:09:30Z'),
  endTimeEnd?: string(name='EndTimeEnd', example='2023-05-02T03:09:30Z'),
  keyword?: string(name='Keyword'),
  modifyTimeBegin?: string(name='ModifyTimeBegin', example='2023-04-02T03:09:30Z'),
  modifyTimeEnd?: string(name='ModifyTimeEnd', example='2023-05-02T03:09:30Z'),
  modifyUserName?: string(name='ModifyUserName', example='test01'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  searchScope?: int32(name='SearchScope', example='1'),
  startTimeBegin?: string(name='StartTimeBegin', example='2022-04-02T03:09:30Z'),
  startTimeEnd?: string(name='StartTimeEnd', example='2022-04-03T03:09:30Z'),
  status?: int32(name='Status', example='1'),
}

model SearchFaqShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryIdsShrink?: string(name='CategoryIds'),
  createTimeBegin?: string(name='CreateTimeBegin', example='2022-04-02T03:09:30Z'),
  createTimeEnd?: string(name='CreateTimeEnd', example='2022-05-02T03:09:30Z'),
  createUserName?: string(name='CreateUserName', example='test01'),
  endTimeBegin?: string(name='EndTimeBegin', example='2023-04-02T03:09:30Z'),
  endTimeEnd?: string(name='EndTimeEnd', example='2023-05-02T03:09:30Z'),
  keyword?: string(name='Keyword'),
  modifyTimeBegin?: string(name='ModifyTimeBegin', example='2023-04-02T03:09:30Z'),
  modifyTimeEnd?: string(name='ModifyTimeEnd', example='2023-05-02T03:09:30Z'),
  modifyUserName?: string(name='ModifyUserName', example='test01'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  searchScope?: int32(name='SearchScope', example='1'),
  startTimeBegin?: string(name='StartTimeBegin', example='2022-04-02T03:09:30Z'),
  startTimeEnd?: string(name='StartTimeEnd', example='2022-04-03T03:09:30Z'),
  status?: int32(name='Status', example='1'),
}

model SearchFaqResponseBody = {
  faqHits?: [ 
    {
      categoryId?: long(name='CategoryId', example='30000055639'),
      createTime?: string(name='CreateTime', example='2022-04-02T03:09:30Z'),
      createUserId?: long(name='CreateUserId', example='18453'),
      createUserName?: string(name='CreateUserName', example='test01'),
      effectStatus?: int32(name='EffectStatus', example='20'),
      hitSimilarTitles?: [ string ](name='HitSimilarTitles'),
      hitSolutions?: [ string ](name='HitSolutions'),
      knowledgeId?: long(name='KnowledgeId', example='30002145804'),
      modifyTime?: string(name='ModifyTime', example='2022-04-02T03:09:30Z'),
      modifyUserId?: long(name='ModifyUserId', example='18453'),
      modifyUserName?: string(name='ModifyUserName', example='test01'),
      status?: int32(name='Status', example='3'),
      title?: string(name='Title'),
    }
  ](name='FaqHits'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='E45491D5-7E0A-42C6-9B21-91D1066B1475'),
  totalCount?: int32(name='TotalCount', example='1075'),
}

model SearchFaqResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchFaqResponseBody(name='body'),
}

/**
 * @summary 知识搜索
 *
 * @param tmpReq SearchFaqRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchFaqResponse
 */
async function searchFaqWithOptions(tmpReq: SearchFaqRequest, runtime: Util.RuntimeOptions): SearchFaqResponse {
  Util.validateModel(tmpReq);
  var request = new SearchFaqShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.categoryIds)) {
    request.categoryIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.categoryIds, 'CategoryIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryIdsShrink)) {
    body['CategoryIds'] = request.categoryIdsShrink;
  }
  if (!Util.isUnset(request.createTimeBegin)) {
    body['CreateTimeBegin'] = request.createTimeBegin;
  }
  if (!Util.isUnset(request.createTimeEnd)) {
    body['CreateTimeEnd'] = request.createTimeEnd;
  }
  if (!Util.isUnset(request.createUserName)) {
    body['CreateUserName'] = request.createUserName;
  }
  if (!Util.isUnset(request.endTimeBegin)) {
    body['EndTimeBegin'] = request.endTimeBegin;
  }
  if (!Util.isUnset(request.endTimeEnd)) {
    body['EndTimeEnd'] = request.endTimeEnd;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.modifyTimeBegin)) {
    body['ModifyTimeBegin'] = request.modifyTimeBegin;
  }
  if (!Util.isUnset(request.modifyTimeEnd)) {
    body['ModifyTimeEnd'] = request.modifyTimeEnd;
  }
  if (!Util.isUnset(request.modifyUserName)) {
    body['ModifyUserName'] = request.modifyUserName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchScope)) {
    body['SearchScope'] = request.searchScope;
  }
  if (!Util.isUnset(request.startTimeBegin)) {
    body['StartTimeBegin'] = request.startTimeBegin;
  }
  if (!Util.isUnset(request.startTimeEnd)) {
    body['StartTimeEnd'] = request.startTimeEnd;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SearchFaq',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 知识搜索
 *
 * @param request SearchFaqRequest
 * @return SearchFaqResponse
 */
async function searchFaq(request: SearchFaqRequest): SearchFaqResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchFaqWithOptions(request, runtime);
}

model UpdateCategoryRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  bizCode?: string(name='BizCode'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='231001028593'),
  name?: string(name='Name', description='This parameter is required.'),
}

model UpdateCategoryResponseBody = {
  requestId?: string(name='RequestId', example='F79E7305-5314-5069-A701-9591AD051902'),
}

model UpdateCategoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCategoryResponseBody(name='body'),
}

/**
 * @summary 编辑类目
 *
 * @param request UpdateCategoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCategoryResponse
 */
async function updateCategoryWithOptions(request: UpdateCategoryRequest, runtime: Util.RuntimeOptions): UpdateCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizCode)) {
    body['BizCode'] = request.bizCode;
  }
  if (!Util.isUnset(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCategory',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 编辑类目
 *
 * @param request UpdateCategoryRequest
 * @return UpdateCategoryResponse
 */
async function updateCategory(request: UpdateCategoryRequest): UpdateCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCategoryWithOptions(request, runtime);
}

model UpdateConnQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  connQuestionId?: long(name='ConnQuestionId', description='This parameter is required.', example='1000000295'),
  outlineId?: long(name='OutlineId', description='This parameter is required.', example='877397683'),
}

model UpdateConnQuestionResponseBody = {
  requestId?: string(name='RequestId', example='004EB5C0-9DEB-53BF-A57A-0407A6D6B3C9'),
}

model UpdateConnQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateConnQuestionResponseBody(name='body'),
}

/**
 * @summary 更新FAQ关联问
 *
 * @param request UpdateConnQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateConnQuestionResponse
 */
async function updateConnQuestionWithOptions(request: UpdateConnQuestionRequest, runtime: Util.RuntimeOptions): UpdateConnQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.connQuestionId)) {
    body['ConnQuestionId'] = request.connQuestionId;
  }
  if (!Util.isUnset(request.outlineId)) {
    body['OutlineId'] = request.outlineId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateConnQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新FAQ关联问
 *
 * @param request UpdateConnQuestionRequest
 * @return UpdateConnQuestionResponse
 */
async function updateConnQuestion(request: UpdateConnQuestionRequest): UpdateConnQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateConnQuestionWithOptions(request, runtime);
}

model UpdateDSEntityRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='123'),
  entityName?: string(name='EntityName', description='This parameter is required.', example='实体名称'),
  entityType?: string(name='EntityType', example='synonyms'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
}

model UpdateDSEntityResponseBody = {
  entityId?: long(name='EntityId', example='123'),
  requestId?: string(name='RequestId', example='df23fgh4hyj67hn56'),
}

model UpdateDSEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDSEntityResponseBody(name='body'),
}

/**
 * @summary 实体-更新
 *
 * @param request UpdateDSEntityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDSEntityResponse
 */
async function updateDSEntityWithOptions(request: UpdateDSEntityRequest, runtime: Util.RuntimeOptions): UpdateDSEntityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.entityName)) {
    query['EntityName'] = request.entityName;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDSEntity',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体-更新
 *
 * @param request UpdateDSEntityRequest
 * @return UpdateDSEntityResponse
 */
async function updateDSEntity(request: UpdateDSEntityRequest): UpdateDSEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDSEntityWithOptions(request, runtime);
}

model UpdateDSEntityValueRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', description='This parameter is required.'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='223423423'),
  entityValueId?: long(name='EntityValueId', description='This parameter is required.', example='2342377423'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  synonyms?: [ string ](name='Synonyms'),
}

model UpdateDSEntityValueShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', description='This parameter is required.'),
  entityId?: long(name='EntityId', description='This parameter is required.', example='223423423'),
  entityValueId?: long(name='EntityValueId', description='This parameter is required.', example='2342377423'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  synonymsShrink?: string(name='Synonyms'),
}

model UpdateDSEntityValueResponseBody = {
  entityValueId?: long(name='EntityValueId', example='2342377423'),
  requestId?: string(name='RequestId', example='sDag3g43wesf2'),
}

model UpdateDSEntityValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDSEntityValueResponseBody(name='body'),
}

/**
 * @summary 实体成员-更新
 *
 * @param tmpReq UpdateDSEntityValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDSEntityValueResponse
 */
async function updateDSEntityValueWithOptions(tmpReq: UpdateDSEntityValueRequest, runtime: Util.RuntimeOptions): UpdateDSEntityValueResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateDSEntityValueShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.synonyms)) {
    request.synonymsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.synonyms, 'Synonyms', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.entityValueId)) {
    query['EntityValueId'] = request.entityValueId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.synonymsShrink)) {
    body['Synonyms'] = request.synonymsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDSEntityValue',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 实体成员-更新
 *
 * @param request UpdateDSEntityValueRequest
 * @return UpdateDSEntityValueResponse
 */
async function updateDSEntityValue(request: UpdateDSEntityValueRequest): UpdateDSEntityValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDSEntityValueWithOptions(request, runtime);
}

model UpdateDocRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='231001028593'),
  config?: string(name='Config', example='{"Splitter":"treeSplitter","ChunkSize":500,"TreePatterns":["^# .*","^## .*","^### .*","^#### .*"],"TitleSource":""}'),
  content?: string(name='Content'),
  docMetadata?: [ 
    {
      businessViewId?: string(name='BusinessViewId'),
      businessViewName?: string(name='BusinessViewName'),
      metaCellInfoDTOList?: [ 
        {
          fieldCode?: string(name='FieldCode'),
          fieldName?: string(name='FieldName'),
          value?: string(name='Value'),
        }
      ](name='MetaCellInfoDTOList'),
    }
  ](name='DocMetadata'),
  docName?: string(name='DocName'),
  endDate?: string(name='EndDate', example='2023-03-11T23:59:59Z'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
  meta?: string(name='Meta', example='{"code":"xxx"}'),
  startDate?: string(name='StartDate', example='2022-05-25T16:28:36Z'),
  tagIds?: [ long ](name='TagIds'),
  title?: string(name='Title'),
}

model UpdateDocShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', example='231001028593'),
  config?: string(name='Config', example='{"Splitter":"treeSplitter","ChunkSize":500,"TreePatterns":["^# .*","^## .*","^### .*","^#### .*"],"TitleSource":""}'),
  content?: string(name='Content'),
  docMetadataShrink?: string(name='DocMetadata'),
  docName?: string(name='DocName'),
  endDate?: string(name='EndDate', example='2023-03-11T23:59:59Z'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
  meta?: string(name='Meta', example='{"code":"xxx"}'),
  startDate?: string(name='StartDate', example='2022-05-25T16:28:36Z'),
  tagIdsShrink?: string(name='TagIds'),
  title?: string(name='Title'),
}

model UpdateDocResponseBody = {
  knowledgeId?: long(name='KnowledgeId', example='30002406051'),
  requestId?: string(name='RequestId', description='Id of the request', example='0F9F136A-1BF6-5CC1-9D57-9717761F03B8'),
}

model UpdateDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDocResponseBody(name='body'),
}

/**
 * @summary 文档变更
 *
 * @param tmpReq UpdateDocRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDocResponse
 */
async function updateDocWithOptions(tmpReq: UpdateDocRequest, runtime: Util.RuntimeOptions): UpdateDocResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateDocShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.docMetadata)) {
    request.docMetadataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.docMetadata, 'DocMetadata', 'json');
  }
  if (!Util.isUnset(tmpReq.tagIds)) {
    request.tagIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagIds, 'TagIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.categoryId)) {
    query['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.config)) {
    query['Config'] = request.config;
  }
  if (!Util.isUnset(request.content)) {
    query['Content'] = request.content;
  }
  if (!Util.isUnset(request.docMetadataShrink)) {
    query['DocMetadata'] = request.docMetadataShrink;
  }
  if (!Util.isUnset(request.docName)) {
    query['DocName'] = request.docName;
  }
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    query['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.meta)) {
    query['Meta'] = request.meta;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.tagIdsShrink)) {
    query['TagIds'] = request.tagIdsShrink;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDoc',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 文档变更
 *
 * @param request UpdateDocRequest
 * @return UpdateDocResponse
 */
async function updateDoc(request: UpdateDocRequest): UpdateDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDocWithOptions(request, runtime);
}

model UpdateFaqRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  categoryId?: long(name='CategoryId', description='This parameter is required.', example='30000049006'),
  endDate?: string(name='EndDate', example='2030-12-31T16:00:00Z'),
  knowledgeId?: long(name='KnowledgeId', description='This parameter is required.', example='30001905617'),
  startDate?: string(name='StartDate', example='2022-05-27T05:18:20Z'),
  title?: string(name='Title', description='This parameter is required.'),
}

model UpdateFaqResponseBody = {
  requestId?: string(name='RequestId', example='736994BD-AA35-4742-88C9-E64BE4BAA14B'),
}

model UpdateFaqResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFaqResponseBody(name='body'),
}

/**
 * @summary 更新FAQ
 *
 * @param request UpdateFaqRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFaqResponse
 */
async function updateFaqWithOptions(request: UpdateFaqRequest, runtime: Util.RuntimeOptions): UpdateFaqResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.categoryId)) {
    body['CategoryId'] = request.categoryId;
  }
  if (!Util.isUnset(request.endDate)) {
    body['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.knowledgeId)) {
    body['KnowledgeId'] = request.knowledgeId;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFaq',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新FAQ
 *
 * @param request UpdateFaqRequest
 * @return UpdateFaqResponse
 */
async function updateFaq(request: UpdateFaqRequest): UpdateFaqResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateFaqWithOptions(request, runtime);
}

model UpdateInstanceRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', example='chatbot-cn-mp90s2lrk00050'),
  introduction?: string(name='Introduction', example='用于C端问答的机器人'),
  name?: string(name='Name', example='智能客服-小C'),
}

model UpdateInstanceResponseBody = {
  requestId?: string(name='RequestId', example='C45BFEE4-F657-1332-8B47-2C757B94C972'),
}

model UpdateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceResponseBody(name='body'),
}

/**
 * @summary 机器人-修改
 *
 * @param request UpdateInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceResponse
 */
async function updateInstanceWithOptions(request: UpdateInstanceRequest, runtime: Util.RuntimeOptions): UpdateInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.introduction)) {
    query['Introduction'] = request.introduction;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstance',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 机器人-修改
 *
 * @param request UpdateInstanceRequest
 * @return UpdateInstanceResponse
 */
async function updateInstance(request: UpdateInstanceRequest): UpdateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceWithOptions(request, runtime);
}

model UpdateIntentRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentDefinition?: {
    aliasName?: string(name='AliasName'),
    intentName?: string(name='IntentName', description='This parameter is required.'),
    slotInfos?: [ 
      {
        array?: boolean(name='Array', example='false'),
        encrypt?: boolean(name='Encrypt', example='false'),
        interactive?: boolean(name='Interactive', example='false'),
        name?: string(name='Name', description='This parameter is required.'),
        slotId?: string(name='SlotId', description='This parameter is required.', example='dgadf23dfg2f'),
        value?: string(name='Value', description='This parameter is required.'),
      }
    ](name='SlotInfos'),
  }(name='IntentDefinition'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='234234234534'),
}

model UpdateIntentShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  intentDefinitionShrink?: string(name='IntentDefinition'),
  intentId?: long(name='IntentId', description='This parameter is required.', example='234234234534'),
}

model UpdateIntentResponseBody = {
  intentId?: long(name='IntentId', example='234234234534'),
  requestId?: string(name='RequestId', example='dfaf23dfas234234234534'),
}

model UpdateIntentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIntentResponseBody(name='body'),
}

/**
 * @summary 意图-更新
 *
 * @param tmpReq UpdateIntentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIntentResponse
 */
async function updateIntentWithOptions(tmpReq: UpdateIntentRequest, runtime: Util.RuntimeOptions): UpdateIntentResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateIntentShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.intentDefinition)) {
    request.intentDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.intentDefinition, 'IntentDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.intentDefinitionShrink)) {
    query['IntentDefinition'] = request.intentDefinitionShrink;
  }
  if (!Util.isUnset(request.intentId)) {
    query['IntentId'] = request.intentId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIntent',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-更新
 *
 * @param request UpdateIntentRequest
 * @return UpdateIntentResponse
 */
async function updateIntent(request: UpdateIntentRequest): UpdateIntentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIntentWithOptions(request, runtime);
}

model UpdateLgfRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  lgfDefinition?: {
    intentId?: long(name='IntentId', description='This parameter is required.', example='23234523522'),
    ruleText?: string(name='RuleText', description='This parameter is required.'),
  }(name='LgfDefinition', description='This parameter is required.'),
  lgfId?: long(name='LgfId', description='LGF ID

This parameter is required.', example='12121'),
}

model UpdateLgfShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  lgfDefinitionShrink?: string(name='LgfDefinition', description='This parameter is required.'),
  lgfId?: long(name='LgfId', description='LGF ID

This parameter is required.', example='12121'),
}

model UpdateLgfResponseBody = {
  lgfId?: long(name='LgfId', example='2342556223532'),
  requestId?: string(name='RequestId', example='289dfa131adf23wqe2r'),
}

model UpdateLgfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLgfResponseBody(name='body'),
}

/**
 * @summary 意图-LGF-更新
 *
 * @param tmpReq UpdateLgfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLgfResponse
 */
async function updateLgfWithOptions(tmpReq: UpdateLgfRequest, runtime: Util.RuntimeOptions): UpdateLgfResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateLgfShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.lgfDefinition)) {
    request.lgfDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.lgfDefinition, 'LgfDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.lgfDefinitionShrink)) {
    query['LgfDefinition'] = request.lgfDefinitionShrink;
  }
  if (!Util.isUnset(request.lgfId)) {
    query['LgfId'] = request.lgfId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLgf',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-LGF-更新
 *
 * @param request UpdateLgfRequest
 * @return UpdateLgfResponse
 */
async function updateLgf(request: UpdateLgfRequest): UpdateLgfResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateLgfWithOptions(request, runtime);
}

model UpdatePerspectiveRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  name?: string(name='Name', example='客户端视角'),
  perspectiveId?: string(name='PerspectiveId', example='3001'),
}

model UpdatePerspectiveResponseBody = {
  requestId?: string(name='RequestId', example='FC384CE1-8D42-1900-84E1-F33F990F2B5E'),
}

model UpdatePerspectiveResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePerspectiveResponseBody(name='body'),
}

/**
 * @summary 视角-修改
 *
 * @param request UpdatePerspectiveRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePerspectiveResponse
 */
async function updatePerspectiveWithOptions(request: UpdatePerspectiveRequest, runtime: Util.RuntimeOptions): UpdatePerspectiveResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.perspectiveId)) {
    query['PerspectiveId'] = request.perspectiveId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePerspective',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 视角-修改
 *
 * @param request UpdatePerspectiveRequest
 * @return UpdatePerspectiveResponse
 */
async function updatePerspective(request: UpdatePerspectiveRequest): UpdatePerspectiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePerspectiveWithOptions(request, runtime);
}

model UpdateSimQuestionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  simQuestionId?: long(name='SimQuestionId', description='This parameter is required.', example='1000002788'),
  title?: string(name='Title', description='This parameter is required.'),
}

model UpdateSimQuestionResponseBody = {
  requestId?: string(name='RequestId', example='DFB71B34-4188-4EA2-9988-EF3014E75910'),
}

model UpdateSimQuestionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSimQuestionResponseBody(name='body'),
}

/**
 * @summary 更新FAQ相似问
 *
 * @param request UpdateSimQuestionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSimQuestionResponse
 */
async function updateSimQuestionWithOptions(request: UpdateSimQuestionRequest, runtime: Util.RuntimeOptions): UpdateSimQuestionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.simQuestionId)) {
    body['SimQuestionId'] = request.simQuestionId;
  }
  if (!Util.isUnset(request.title)) {
    body['Title'] = request.title;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSimQuestion',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新FAQ相似问
 *
 * @param request UpdateSimQuestionRequest
 * @return UpdateSimQuestionResponse
 */
async function updateSimQuestion(request: UpdateSimQuestionRequest): UpdateSimQuestionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSimQuestionWithOptions(request, runtime);
}

model UpdateSolutionRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  content?: string(name='Content', description='This parameter is required.'),
  contentType?: int32(name='ContentType', example='1'),
  perspectiveCodes?: [ string ](name='PerspectiveCodes', description='This parameter is required.'),
  solutionId?: long(name='SolutionId', description='This parameter is required.', example='100001333260'),
}

model UpdateSolutionResponseBody = {
  requestId?: string(name='RequestId', example='8B8F098D-A338-54DD-B19C-24BBBCBD8498'),
}

model UpdateSolutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSolutionResponseBody(name='body'),
}

/**
 * @summary 更新FAQ答案
 *
 * @param request UpdateSolutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSolutionResponse
 */
async function updateSolutionWithOptions(request: UpdateSolutionRequest, runtime: Util.RuntimeOptions): UpdateSolutionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['Content'] = request.content;
  }
  if (!Util.isUnset(request.contentType)) {
    body['ContentType'] = request.contentType;
  }
  if (!Util.isUnset(request.perspectiveCodes)) {
    body['PerspectiveCodes'] = request.perspectiveCodes;
  }
  if (!Util.isUnset(request.solutionId)) {
    body['SolutionId'] = request.solutionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSolution',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新FAQ答案
 *
 * @param request UpdateSolutionRequest
 * @return UpdateSolutionResponse
 */
async function updateSolution(request: UpdateSolutionRequest): UpdateSolutionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSolutionWithOptions(request, runtime);
}

model UpdateUserSayRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  userSayDefinition?: {
    content?: string(name='Content', description='This parameter is required.'),
    intentId?: long(name='IntentId', description='This parameter is required.', example='123'),
    slotInfos?: [ 
      {
        endIndex?: int32(name='EndIndex', example='3'),
        slotId?: string(name='SlotId', example='346ffg3q23dv'),
        startIndex?: int32(name='StartIndex', example='1'),
      }
    ](name='SlotInfos'),
  }(name='UserSayDefinition'),
  userSayId?: long(name='UserSayId', description='This parameter is required.', example='34512323'),
}

model UpdateUserSayShrinkRequest {
  agentKey?: string(name='AgentKey', example='ac627989eb4f8a98ed05fd098bbae5_p_beebot_public'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='chatbot-cn-yjzbyrEvqd'),
  userSayDefinitionShrink?: string(name='UserSayDefinition'),
  userSayId?: long(name='UserSayId', description='This parameter is required.', example='34512323'),
}

model UpdateUserSayResponseBody = {
  requestId?: string(name='RequestId', example='2356fg3wf34634vdt23wef2'),
  userSayId?: long(name='UserSayId', example='34512323'),
}

model UpdateUserSayResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserSayResponseBody(name='body'),
}

/**
 * @summary 意图-话术-更新
 *
 * @param tmpReq UpdateUserSayRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateUserSayResponse
 */
async function updateUserSayWithOptions(tmpReq: UpdateUserSayRequest, runtime: Util.RuntimeOptions): UpdateUserSayResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateUserSayShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.userSayDefinition)) {
    request.userSayDefinitionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.userSayDefinition, 'UserSayDefinition', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.agentKey)) {
    query['AgentKey'] = request.agentKey;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.userSayDefinitionShrink)) {
    query['UserSayDefinition'] = request.userSayDefinitionShrink;
  }
  if (!Util.isUnset(request.userSayId)) {
    query['UserSayId'] = request.userSayId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateUserSay',
    version = '2022-04-08',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 意图-话术-更新
 *
 * @param request UpdateUserSayRequest
 * @return UpdateUserSayResponse
 */
async function updateUserSay(request: UpdateUserSayRequest): UpdateUserSayResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateUserSayWithOptions(request, runtime);
}

